Expand all

abstract ve.ui.MWCategoryWidget

Extends

Constructor

new ve.ui.MWCategoryWidget([config])abstract #

Creates an ve.ui.MWCategoryWidget object.

Parameters:

Name Type Attributes Description
config Object optional

Configuration options

Properties:
Name Type Attributes Description
$overlay jQuery optional

Overlay to render dropdowns in

Mixes in:
Source:
Creates an ve.ui.MWCategoryWidget object.

Methods

addItems(items, [index]) → {jQuery.Promise} #

Adds category items.

Parameters:

Name Type Attributes Description
items Array.<Object>

Items to add

index number optional

Index to insert items after

Source:

Returns:

Type
jQuery.Promise
Adds category items.

fitInput() #

Auto-fit the input.

focus() #

Focus the widget

getCategories() → {Array.<string>} #

Get list of category names.

Source:

Returns:

List of category names

Type
Array.<string>
Get list of category names.

getCategoryItemFromValue(value) → {Object} #

Get a category item.

Parameters:

Name Type Description
value string

Category name

Source:

Returns:

Category item with name, value and metaItem properties

Type
Object
Get a category item.

onDrag(item, newIndex) #

Parameters:

Name Type Description
item ve.ui.MWCategoryItemWidget

Item that was moved

newIndex number

The new index of the item

Source:

onInputChoose(item) #

Handle input 'choose' event.

Parameters:

Name Type Description
item OO.ui.MenuOptionWidget

Selected item

Source:
Handle input 'choose' event.

onPopupClosing() #

Handle popup closing dialog

Source:
Handle popup closing dialog

onPopupOpened() #

Hanle popup open event

Source:
Hanle popup open event

onRemoveCategory(name) #

Removes category from model.

Parameters:

Name Type Description
name string

Removed category name

Source:
Removes category from model.

onTogglePopupMenu(item) #

Toggles popup menu per category item

Parameters:

Name Type Description
item Object
Source:
Toggles popup menu per category item

onUpdateSortkey(name, value) #

Update sortkey value, emit updateSortkey event

Parameters:

Name Type Description
name string
value string
Source:

Fires:

Update sortkey value, emit updateSortkey event

queryCategoryStatus(categoryNames) → {jQuery.Promise} #

Starts a request to update the link cache's hidden and missing status for the given titles, following normalisation responses as necessary.

Parameters:

Name Type Description
categoryNames Array.<string>
Source:

Returns:

Type
jQuery.Promise

Starts a request to update the link cache's hidden and missing status for the given titles, following normalisation responses as necessary.

setDefaultSortKey(value) #

Set the default sort key.

Parameters:

Name Type Description
value string

Default sort key value

Source:
Set the default sort key.

setFragment(fragment) #

Surface fragment for modifying meta list

Parameters:

Name Type Description
fragment ve.dm.SurfaceFragment | null

Surface fragment

Source:
Surface fragment for modifying meta list

Events

newCategory(item, [beforeCategory]) #

Parameters:

Name Type Attributes Description
item Object

Category item

Properties:
Name Type Description
name string

Fully prefixed category name

value string

Category value (name without prefix)

metaItem ve.dm.MWCategoryMetaItem
beforeCategory ve.dm.MetaItem optional

Insert after this category; if unset, insert at the end

Source:

updateSortkey(item) #

Parameters:

Name Type Description
item Object

Category item

Properties:
Name Type Description
name string

Fully prefixed category name

value string

Category value (name without prefix)

metaItem ve.dm.MWCategoryMetaItem
Source: