-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
jquery: add vector skin's collapsibleTabs plugin
- Loading branch information
1 parent
6f4e3cc
commit a57cf77
Showing
3 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/** | ||
* CollapsibleTabsPlugin used in MediaWiki vector skin | ||
* Copied from https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/skins/Vector/+/master/resources/CollapsibleTabsPlugin.d.ts | ||
*/ | ||
|
||
declare global { | ||
interface JQueryStatic { | ||
collapsibleTabs: CollapsibleTabsStatic; | ||
} | ||
interface JQuery { | ||
collapsibleTabs(options: Partial<CollapsibleTabsOptions>): void; | ||
} | ||
} | ||
|
||
/** A jQuery plugin that makes collapsible tabs for the Vector skin. */ | ||
interface CollapsibleTabsOptions { | ||
/** Optional tab selector. Defaults to `#p-views ul`. */ | ||
expandedContainer: string; | ||
/** Optional menu item selector. Defaults to `#p-cactions ul`. */ | ||
collapsedContainer: string; | ||
/** Optional selector for tabs that are collapsible. Defaults to `li.collapsible`. */ | ||
collapsible: string; | ||
shifting: boolean; | ||
expandedWidth: number; | ||
expandCondition(eleWidth: number): boolean; | ||
collapseCondition(): boolean; | ||
} | ||
|
||
interface CollapsibleTabsStatic { | ||
defaults: CollapsibleTabsOptions; | ||
instances: JQuery[]; | ||
addData($collapsible: JQuery): void; | ||
getSettings($collapsible: JQuery): CollapsibleTabsOptions; | ||
handleResize(): void; | ||
moveToCollapsed($moving: JQuery): void; | ||
moveToExpanded($moving: JQuery): void; | ||
calculateTabDistance(): number; | ||
} | ||
|
||
interface CollapsibleTabs extends CollapsibleTabsStatic, CollapsibleTabsOptions {} | ||
|
||
export {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import 'jquery'; | ||
|
||
import './textSelection'; | ||
import './collapsibleTabs'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters