Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Expose compact mode as an option

* some minor space cleanup
* Also close the ULS window when clicked outside

Change-Id: I06b465926196f79e47990e80e3b23f5a16474ba3
  • Loading branch information...
commit 0340e609a045d2ce3e70d649df530756127489fb 1 parent 44ff5e0
@santhoshtr santhoshtr authored
View
2  css/jquery.uls.compact.css
@@ -18,7 +18,7 @@
}
.uls-compact .filterinput,
-.uls-compact .filterinput:focus {
+.uls-compact .filterinput:focus {
background-color: transparent;
border: none;
box-shadow: none;
View
14 examples/index-compact.html
@@ -26,20 +26,10 @@
var languageName = $.uls.data.getAutonym( language );
$( '.uls-trigger' ).text( languageName );
},
+ compact: true,
quickList: [ 'en', 'hi', 'he', 'ml', 'ta', 'fr' ]
} );
- $( '.uls-trigger' ).click( function () {
- //Hacks to include optional classes and make the dialog close when clicking outside:
- $( '.uls-menu' ).addClass( 'uls-compact' );
- $( 'html' ).click( function () {
- $( '.uls-menu' ).hide();
- } );
-
- $( '.uls-menu' ).click( function ( event ) {
- event.stopPropagation();
- } );
- } );
- } );
+ } );
</script>
</head>
View
2  grunt.js
@@ -23,7 +23,7 @@ module.exports = function(grunt) {
},
css: {
src: [ 'css/jquery.uls.css', 'css/jquery.uls.grid.css',
- 'css/jquery.uls.lcd.css' ],
+ 'css/jquery.uls.lcd.css', 'css/jquery.uls.compact.css' ],
dest : 'dist/<%= pkg.name %>/css/<%= pkg.name %>.css'
}
},
View
7 src/jquery.uls.core.js
@@ -143,6 +143,10 @@
left: '25%'
} );
+ if ( this.options.compact ) {
+ this.$menu.addClass( 'uls-compact' );
+ }
+
if ( !this.initialized ) {
$( 'body' ).prepend( this.$menu );
this.i18n();
@@ -281,6 +285,8 @@
uls.$languageFilter.languagefilter( 'clear' );
}
} );
+
+ $( 'html' ).click( $.proxy( this.hide, this ) );
},
/**
@@ -383,6 +389,7 @@
languages: $.uls.data.getAutonyms(), // Languages to be used for ULS, default is all languages
quickList: null, // Array of language codes or function that returns such
lazyload: true, // Lazy load the language list when scrolled.
+ compact: false, // Show ULS in compact mode
showRegions: ['WW', 'AM', 'EU', 'ME', 'AF', 'AS', 'PA']
};
Please sign in to comment.
Something went wrong with that request. Please try again.