Skip to content

Instantly share code, notes, and snippets.

@edg2s
Created May 16, 2014 21:43
Show Gist options
  • Save edg2s/18b8879766d7ea45c6db to your computer and use it in GitHub Desktop.
Save edg2s/18b8879766d7ea45c6db to your computer and use it in GitHub Desktop.
/**
* Focusable element.
*
* @abstract
* @class
*
* @constructor
*/
OO.ui.FocusableElement = function OoUiFocusableElement() {
// add tabindex
};
/* Methods */
/**
* Get focusable element.
*
* @return {jQuery} Focusable element
*/
OO.ui.FocusableElement.prototype.getFocusableElement = function () {
throw new Error(
'OO.ui.FocusableElement.getFocusableElement not implemented in this class:' + this.constructor
);
};
/**
* Show popup.
*/
OO.ui.FocusableElement.prototype.focus = function () {
this.getFocusableElement()[0].focus();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment