Fix initial values in the pad creation screen
This commit is contained in:
@@ -1947,7 +1947,6 @@ define([
|
|||||||
'class': 'cp-creation-template-element',
|
'class': 'cp-creation-template-element',
|
||||||
'title': name,
|
'title': name,
|
||||||
}).appendTo($container);
|
}).appendTo($container);
|
||||||
console.log(obj.id);
|
|
||||||
$span.data('id', obj.id);
|
$span.data('id', obj.id);
|
||||||
if (idx === 0) { $span.addClass('cp-creation-template-selected'); }
|
if (idx === 0) { $span.addClass('cp-creation-template-selected'); }
|
||||||
$span.append(obj.icon || UI.getFileIcon({type: type}));
|
$span.append(obj.icon || UI.getFileIcon({type: type}));
|
||||||
@@ -2015,10 +2014,10 @@ define([
|
|||||||
|
|
||||||
// Initial values
|
// Initial values
|
||||||
if (!cfg.owned && typeof cfg.owned !== "undefined") {
|
if (!cfg.owned && typeof cfg.owned !== "undefined") {
|
||||||
$creation.find('#cp-creation-owned').attr('checked', false);
|
$creation.find('#cp-creation-owned').prop('checked', false);
|
||||||
}
|
}
|
||||||
if (cfg.skip) {
|
if (cfg.skip) {
|
||||||
$creation.find('#cp-creation-remember').attr('checked', 'checked');
|
$creation.find('#cp-creation-remember').prop('checked', true).trigger('change');
|
||||||
}
|
}
|
||||||
UIElements.setExpirationValue(cfg.expire, $creation);
|
UIElements.setExpirationValue(cfg.expire, $creation);
|
||||||
|
|
||||||
@@ -2079,44 +2078,6 @@ define([
|
|||||||
create();
|
create();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Save settings button
|
|
||||||
/*var $ok = $('<span>', {'class': 'fa fa-check', title: Messages.saved}).hide();
|
|
||||||
var $spinner = $('<span>', {'class': 'fa fa-spinner fa-pulse'}).hide();
|
|
||||||
var okTo;
|
|
||||||
var $saveButton = $('<button>').text(Messages.creation_saveSettings).click(function () {
|
|
||||||
if (okTo) { clearTimeout(okTo); }
|
|
||||||
$ok.hide();
|
|
||||||
$spinner.show();
|
|
||||||
var val = getFormValues();
|
|
||||||
NThen(function (waitFor) {
|
|
||||||
common.setAttribute(['general', 'creation', 'owned'], val.owned, waitFor(function (e) {
|
|
||||||
if (e) { return void console.error(e); }
|
|
||||||
}));
|
|
||||||
common.setAttribute(['general', 'creation', 'expire'], val.expire, waitFor(function (e) {
|
|
||||||
if (e) { return void console.error(e); }
|
|
||||||
}));
|
|
||||||
}).nThen(function () {
|
|
||||||
$spinner.hide();
|
|
||||||
$ok.show();
|
|
||||||
okTo = setTimeout(function () {
|
|
||||||
$ok.hide();
|
|
||||||
}, 5000);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
var settings = h('div.cp-creation-settings', [
|
|
||||||
h('button.cp-creation-settings-save', Messages.creation_saveSettings),
|
|
||||||
$ok[0],
|
|
||||||
$spinner[0],
|
|
||||||
h('span.cp-filler'),
|
|
||||||
createHelper('/settings/#creation')
|
|
||||||
//h('a', {
|
|
||||||
// href: origin + '/settings/#creation',
|
|
||||||
// target: '_blank'
|
|
||||||
//}, Messages.creation_settings),
|
|
||||||
]);*/
|
|
||||||
|
|
||||||
|
|
||||||
$creation.keydown(function (e) {
|
$creation.keydown(function (e) {
|
||||||
if (e.which === 9) {
|
if (e.which === 9) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|||||||
@@ -189,7 +189,6 @@ define([
|
|||||||
return void funcs.createPad(c, waitFor());
|
return void funcs.createPad(c, waitFor());
|
||||||
}
|
}
|
||||||
// If we display the pad creation screen, it will handle deleted pads directly
|
// If we display the pad creation screen, it will handle deleted pads directly
|
||||||
console.log('here');
|
|
||||||
funcs.getPadCreationScreen(c, waitFor());
|
funcs.getPadCreationScreen(c, waitFor());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user