mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 07:56:16 -04:00
mobile: ability to display hidden toolbar buttons
This commit is contained in:
parent
d6aec95684
commit
1d927854a4
3 changed files with 57 additions and 5 deletions
|
@ -24,6 +24,7 @@ var hooks = require('./pluginfw/hooks');
|
|||
var padutils = require('./pad_utils').padutils;
|
||||
var padeditor = require('./pad_editor').padeditor;
|
||||
var padsavedrevs = require('./pad_savedrevs');
|
||||
var _ = require('ep_etherpad-lite/static/js/underscore');
|
||||
|
||||
var ToolbarItem = function (element) {
|
||||
this.$el = element;
|
||||
|
@ -155,6 +156,12 @@ var padeditbar = (function()
|
|||
bodyKeyEvent(evt);
|
||||
});
|
||||
|
||||
$('.show-more-icon-btn').click(function() {
|
||||
$('.toolbar').toggleClass('full-icons');
|
||||
});
|
||||
self.checkAllIconsAreDisplayedInToolbar();
|
||||
$(window).resize(_.debounce( self.checkAllIconsAreDisplayedInToolbar, 100 ) );
|
||||
|
||||
registerDefaultCommands(self);
|
||||
|
||||
hooks.callAll("postToolbarInit", {
|
||||
|
@ -278,6 +285,15 @@ var padeditbar = (function()
|
|||
$('#embedinput').val('<iframe name="embed_readwrite" src="' + padurl + '?showControls=true&showChat=true&showLineNumbers=true&useMonospaceFont=false" width=600 height=400></iframe>');
|
||||
$('#linkinput').val(padurl);
|
||||
}
|
||||
},
|
||||
checkAllIconsAreDisplayedInToolbar: function()
|
||||
{
|
||||
// reset style
|
||||
$('.toolbar').removeClass('cropped')
|
||||
var menu_left = $('.toolbar .menu_left')[0];
|
||||
if (menu_left && menu_left.scrollWidth > $('.toolbar').width()) {
|
||||
$('.toolbar').addClass('cropped');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue