/*!
- * OOjs UI v0.16.4
+ * OOjs UI v0.16.5
* https://www.mediawiki.org/wiki/OOjs_UI
*
* Copyright 2011–2016 OOjs UI Team and other contributors.
* Released under the MIT license
* http://oojs.mit-license.org
*
- * Date: 2016-03-22T22:48:21Z
+ * Date: 2016-04-07T15:12:41Z
*/
( function ( OO ) {
this.setGroupElement( config.$group || $( '<div>' ) );
};
+/* Events */
+
+/**
+ * @event change
+ *
+ * A change event is emitted when the set of selected items changes.
+ *
+ * @param {OO.ui.Element[]} items Items currently in the group
+ */
+
/* Methods */
/**
this.items.splice.apply( this.items, [ index, 0 ].concat( items ) );
}
+ this.emit( 'change', this.getItems() );
return this;
};
}
}
+ this.emit( 'change', this.getItems() );
return this;
};
item.$element.detach();
}
+ this.emit( 'change', this.getItems() );
this.items = [];
return this;
};
*/
OO.ui.InputWidget.static.gatherPreInfuseState = function ( node, config ) {
var state = OO.ui.InputWidget.parent.static.gatherPreInfuseState( node, config );
- state.value = config.$input.val();
- // Might be better in TabIndexedElement, but it's awkward to do there because mixins are awkward
- state.focus = config.$input.is( ':focus' );
+ if ( config.$input && config.$input.length ) {
+ state.value = config.$input.val();
+ // Might be better in TabIndexedElement, but it's awkward to do there because mixins are awkward
+ state.focus = config.$input.is( ':focus' );
+ }
return state;
};
return state;
};
+/**
+ * @inheritdoc
+ */
+OO.ui.RadioSelectInputWidget.static.reusePreInfuseDOM = function ( node, config ) {
+ config = OO.ui.RadioSelectInputWidget.parent.static.reusePreInfuseDOM( node, config );
+ // Cannot reuse the `<input type=radio>` set
+ delete config.$input;
+ return config;
+};
+
/* Methods */
/**
OO.ui.ComboBoxInputWidget = function OoUiComboBoxInputWidget( config ) {
// Configuration initialization
config = $.extend( {
- indicator: 'down'
+ indicator: 'down',
+ autocomplete: false
}, config );
// For backwards-compatibility with ComboBoxWidget config
$.extend( config, config.input );