diff --git a/resources/mmv/ui/mmv.ui.js b/resources/mmv/ui/mmv.ui.js index aae322259..3a86b511e 100644 --- a/resources/mmv/ui/mmv.ui.js +++ b/resources/mmv/ui/mmv.ui.js @@ -219,6 +219,29 @@ } ); }; + /** + * Makes the entire input/textarea selected when focused. + * Invoked with that input/textarea as context. + */ + EP.selectAllOnEvent = function () { + try { + this.select(); + } catch ( e ) { + // IE doesn't like when select() is called during the onfocus handler + } + }; + + /** + * Reduces the action of clicks to solely focusing the input/textarea. + * Essentialy disables clicking inside the text to select a portion of it. + * Invoked with that input/textarea as context. + */ + EP.onlyFocus = function ( e ) { + this.focus(); + e.preventDefault(); + return false; + }; + mw.mmv.ui = {}; mw.mmv.ui.reuse = {}; mw.mmv.ui.Element = Element; diff --git a/resources/mmv/ui/mmv.ui.reuse.tab.js b/resources/mmv/ui/mmv.ui.reuse.tab.js index 4adb32fb3..1fec1f991 100644 --- a/resources/mmv/ui/mmv.ui.reuse.tab.js +++ b/resources/mmv/ui/mmv.ui.reuse.tab.js @@ -52,28 +52,5 @@ this.$pane.removeClass( 'active' ); }; - /** - * Makes the entire input/textarea selected when focused. - * Invoked with that input/textarea as context. - */ - TP.selectAllOnEvent = function () { - try { - this.select(); - } catch ( e ) { - // IE doesn't like when select() is called during the onfocus handler - } - }; - - /** - * Reduces the action of clicks to solely focusing the input/textarea. - * Essentialy disables clicking inside the text to select a portion of it. - * Invoked with that input/textarea as context. - */ - TP.onlyFocus = function ( e ) { - this.focus(); - e.preventDefault(); - return false; - }; - mw.mmv.ui.reuse.Tab = Tab; }( mediaWiki, jQuery, OO ) );