/*!
- * 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 ) {
.removeAttr( 'tabindex' )
.addClass( 'oo-ui-buttonedElement-pressed' );
this.getElementDocument().addEventListener( 'mouseup', this.onMouseUpHandler, true );
+ return false;
};
/**
// Mixin constructors
OO.ui.IconedElement.call( this, this.$( '<div>' ), config );
- OO.ui.LabeledElement.call( this, this.$( '<legend>' ), config );
+ OO.ui.LabeledElement.call( this, this.$( '<div>' ), config );
OO.ui.GroupElement.call( this, this.$( '<div>' ), config );
// Initialization
/* Static Properties */
-OO.ui.FieldsetLayout.static.tagName = 'fieldset';
+OO.ui.FieldsetLayout.static.tagName = 'div';
/**
* Layout made of a field and optional label.
*
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;
}
*/
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 ) } );
}
};
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 );
/*!
- * 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 */
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;