Make automatic pad storage configurable

This commit is contained in:
yflory
2018-08-28 11:42:48 +02:00
parent e8a5244362
commit 9ebb598467
13 changed files with 288 additions and 82 deletions

View File

@@ -879,9 +879,12 @@ define([
UI.createRadio = Pages.createRadio;
UI.cornerPopup = function (text, actions, footer) {
// XXX create "minimize" icon
UI.cornerPopup = function (text, actions, footer, startHidden) {
var minimize = h('div.cp-corner-minimize.fa.fa-window-minimize');
var maximize = h('div.cp-corner-maximize.fa.fa-window-maximize');
var popup = h('div.cp-corner-container', [
minimize,
maximize,
h('div.cp-corner-filler', { style: "width:130px;" }),
h('div.cp-corner-filler', { style: "width:90px;" }),
h('div.cp-corner-filler', { style: "width:60px;" }),
@@ -889,9 +892,20 @@ define([
h('div.cp-corner-filler', { style: "width:20px;" }),
h('div.cp-corner-text', text),
h('div.cp-corner-actions', actions),
h('div.cp-corner-footer', footer)
Pages.setHTML(h('div.cp-corner-footer'), footer)
]);
$(minimize).click(function () {
$(popup).addClass('cp-minimized');
});
$(maximize).click(function () {
$(popup).removeClass('cp-minimized');
});
if (startHidden) {
$(popup).addClass('cp-minimized');
}
var hide = function () {
$(popup).hide();
};
@@ -905,6 +919,7 @@ define([
$('body').append(popup);
return {
popup: popup,
hide: hide,
show: show,
delete: deletePopup