Add a more settings link instead of the help link

It opens the input settings panel of ULS

Change-Id: I6d22585f735073d3d7d3e59eba24befe72238786
This commit is contained in:
Santhosh Thottingal
2012-10-29 16:17:41 +05:30
parent 15b19d9f32
commit 4818545939
3 changed files with 46 additions and 2 deletions

View File

@@ -32,4 +32,20 @@ div.input-settings-block {
text-decoration: none; text-decoration: none;
color: #ffffff; color: #ffffff;
background-color: #5089e8; background-color: #5089e8;
} }
.uls-ime-more-settings-link {
/* @embed */
background: transparent url('../images/cog-16x16-ltr.png') right center no-repeat;
background-color: #f0f0f0;
border-radius: 0 0 5px 5px;
border-top: 1px solid #ddd;
margin-top: 6px;
padding: 2px 0 2px 0;
color: #444;
}
.uls-ime-more-settings-link > a:hover {
background-color: #f0f0f0;
color: #000;
}

View File

@@ -75,6 +75,34 @@
imePath: mwImeRulesPath imePath: mwImeRulesPath
} ); } );
// Add a 'more setttings' link that takes to input settings of ULS
$.fn.imeselector.Constructor.prototype.helpLink = function () {
var $moreSettingsLink, imeselector;
imeselector = this;
$moreSettingsLink = $( '<a>' ).text( 'More settings' )
.addClass( 'uls-ime-more-settings-link' )
.attr( 'data-i18n', 'ext-uls-ime-more-settings' );
$moreSettingsLink.languagesettings( {
defaultModule: 'input',
onClose: function () {
// on close of input settings, keep focus in input area.
imeselector.$element.focus();
},
top: imeselector.$element.offset().top
} );
// Hide the menu.
$moreSettingsLink.on( 'click', function (e) {
imeselector.$menu.removeClass( 'open' );
e.stopPropagation();
} );
return $moreSettingsLink;
};
$( document ).ready( function () { $( document ).ready( function () {
$( 'body' ).on( 'focus', inputSelector, function () { $( 'body' ).on( 'focus', inputSelector, function () {

View File

@@ -351,7 +351,7 @@
onSave: function ( success ) { onSave: function ( success ) {
if ( success ) { if ( success ) {
// Live ime update // Live ime update
this.$parent.hide(); this.$parent.close();
} else { } else {
// FIXME failure. what to do?! // FIXME failure. what to do?!
} }