From: Roan Kattouw Date: Wed, 16 Apr 2014 18:09:43 +0000 (-0700) Subject: Update OOjs UI to v0.1.0-pre (c58b498573) X-Git-Tag: 1.31.0-rc.0~16195^2 X-Git-Url: http://git.cyclocoop.org//%27%40script%40/%27?a=commitdiff_plain;h=ad4d3f159336850db894e881605ef78851c2a8e9;p=lhc%2Fweb%2Fwiklou.git Update OOjs UI to v0.1.0-pre (c58b498573) New changes: 4bf6a2e Buttons return false on mouse down c0eeb38 Only blur inputs within booklet pages when moving away 099f26e Make fieldset layouts render correctly Change-Id: I919b9587242d4f40ffc2943d39bd91695a7c07e7 --- diff --git a/resources/lib/oojs-ui/oojs-ui-apex.css b/resources/lib/oojs-ui/oojs-ui-apex.css index 64a8e387a8..b6e8d3a5e6 100644 --- a/resources/lib/oojs-ui/oojs-ui-apex.css +++ b/resources/lib/oojs-ui/oojs-ui-apex.css @@ -303,7 +303,7 @@ border: none; } -.oo-ui-fieldsetLayout > legend.oo-ui-labeledElement-label { +.oo-ui-fieldsetLayout > .oo-ui-labeledElement-label { font-size: 1.5em; } diff --git a/resources/lib/oojs-ui/oojs-ui.js b/resources/lib/oojs-ui/oojs-ui.js index 3878a65b4a..6ea6ec9f2d 100644 --- a/resources/lib/oojs-ui/oojs-ui.js +++ b/resources/lib/oojs-ui/oojs-ui.js @@ -1,12 +1,12 @@ /*! - * OOjs UI v0.1.0-pre (8197f2cd2e) + * OOjs UI v0.1.0-pre (c58b498573) * https://www.mediawiki.org/wiki/OOjs_UI * * Copyright 2011–2014 OOjs Team and other contributors. * Released under the MIT license * http://oojs.mit-license.org * - * Date: Tue Apr 15 2014 11:07:39 GMT-0700 (PDT) + * Date: Wed Apr 16 2014 11:09:39 GMT-0700 (PDT) */ ( function ( OO ) { @@ -1890,6 +1890,7 @@ OO.ui.ButtonedElement.prototype.onMouseDown = function () { .removeAttr( 'tabindex' ) .addClass( 'oo-ui-buttonedElement-pressed' ); this.getElementDocument().addEventListener( 'mouseup', this.onMouseUpHandler, true ); + return false; }; /** @@ -3637,7 +3638,7 @@ OO.ui.FieldsetLayout = function OoUiFieldsetLayout( config ) { // Mixin constructors OO.ui.IconedElement.call( this, this.$( '
' ), config ); - OO.ui.LabeledElement.call( this, this.$( '' ), config ); + OO.ui.LabeledElement.call( this, this.$( '
' ), config ); OO.ui.GroupElement.call( this, this.$( '
' ), config ); // Initialization @@ -3658,7 +3659,7 @@ OO.mixinClass( OO.ui.FieldsetLayout, OO.ui.GroupElement ); /* Static Properties */ -OO.ui.FieldsetLayout.static.tagName = 'fieldset'; +OO.ui.FieldsetLayout.static.tagName = 'div'; /** * Layout made of a field and optional label. * @@ -4041,14 +4042,11 @@ OO.inheritClass( OO.ui.BookletLayout, OO.ui.Layout ); OO.ui.BookletLayout.prototype.onStackLayoutFocus = function ( e ) { var name, $target; - if ( this.ignoreFocus ) { - // Avoid recursion from programmatic focus trigger in #onStackLayoutSet - return; - } - + // Find the page that an element was focused within $target = $( e.target ).closest( '.oo-ui-pageLayout' ); for ( name in this.pages ) { - if ( this.pages[ name ].$element[0] === $target[0] ) { + // Check for page match, exclude current page to find only page changes + if ( this.pages[name].$element[0] === $target[0] && name !== this.currentPageName ) { this.setPage( name ); break; } @@ -4062,13 +4060,13 @@ OO.ui.BookletLayout.prototype.onStackLayoutFocus = function ( e ) { */ OO.ui.BookletLayout.prototype.onStackLayoutSet = function ( page ) { if ( page ) { - this.stackLayout.$element.find( ':focus' ).blur(); page.scrollElementIntoView( { 'complete': OO.ui.bind( function () { - this.ignoreFocus = true; if ( this.autoFocus ) { - page.$element.find( ':input:first' ).focus(); + // Set focus to the first input if nothing on the page is focused yet + if ( !page.$element.find( ':focus' ).length ) { + page.$element.find( ':input:first' ).focus(); + } } - this.ignoreFocus = false; }, this ) } ); } }; @@ -4329,6 +4327,12 @@ OO.ui.BookletLayout.prototype.setPage = function ( name ) { if ( page ) { if ( this.currentPageName && this.pages[this.currentPageName] ) { this.pages[this.currentPageName].setActive( false ); + // Blur anything focused if the next page doesn't have anything focusable - this + // is not needed if the next page has something focusable because once it is focused + // this blur happens automatically + if ( this.autoFocus && !page.$element.find( ':input' ).length ) { + this.pages[this.currentPageName].$element.find( ':focus' ).blur(); + } } this.currentPageName = name; this.stackLayout.setItem( page ); diff --git a/resources/lib/oojs-ui/oojs-ui.svg.css b/resources/lib/oojs-ui/oojs-ui.svg.css index 0353288ecf..6423a4cc3d 100644 --- a/resources/lib/oojs-ui/oojs-ui.svg.css +++ b/resources/lib/oojs-ui/oojs-ui.svg.css @@ -1,12 +1,12 @@ /*! - * OOjs UI v0.1.0-pre (8197f2cd2e) + * OOjs UI v0.1.0-pre (c58b498573) * https://www.mediawiki.org/wiki/OOjs_UI * * Copyright 2011–2014 OOjs Team and other contributors. * Released under the MIT license * http://oojs.mit-license.org * - * Date: Tue Apr 15 2014 11:07:39 GMT-0700 (PDT) + * Date: Wed Apr 16 2014 11:09:38 GMT-0700 (PDT) */ /* Textures */ @@ -433,18 +433,19 @@ margin-top: -0.75em; } -.oo-ui-fieldsetLayout > legend.oo-ui-labeledElement-label { +.oo-ui-fieldsetLayout > .oo-ui-labeledElement-label { padding: 0.25em 0; margin-bottom: 0.5em; } -.oo-ui-fieldsetLayout.oo-ui-iconedElement > legend.oo-ui-labeledElement-label { +.oo-ui-fieldsetLayout.oo-ui-iconedElement > .oo-ui-labeledElement-label { padding-left: 1.75em; + line-height: 1.33em; } .oo-ui-fieldsetLayout.oo-ui-iconedElement > .oo-ui-iconedElement-icon { position: absolute; - top: 0; + top: 0.25em; left: 0; display: block; width: 2em;