Fix colors and reload bugs in slides

pull/1/head
yflory 5 years ago
parent d587a23418
commit a62ea39122

@ -1115,7 +1115,13 @@ define([
if (parsed.hashData) { currentPad.hash = parsed.hashData.getHash(opts); }
// Rendered (maybe hidden) hash
var hiddenParsed = Utils.Hash.parsePadUrl(window.location.href);
// Update the hash in the address bar
var ohc = window.onhashchange;
window.onhashchange = function () {};
window.location.href = hiddenParsed.getUrl(opts);
window.onhashchange = ohc;
ohc({reset: true});
});

@ -348,7 +348,7 @@ define([
}
if (back) {
backColor = back;
//$modal.css('background-color', back);
$modal.find('.cp-app-slide-frame').css('background-color', back);
$('#' + SLIDE_BACKCOLOR_ID).find('i').css('color', back);
slideOptions.bgColor = back;
}
@ -362,6 +362,10 @@ define([
framework.localChange();
};
var $check = $("#cp-app-slide-colorpicker");
var $backgroundPicker = $('<input>', { type: 'color', value: backColor })
.css({ display: 'none', })
.on('change', function() { updateLocalColors(undefined, this.value); });
var $back = framework._.sfCommon.createButton(null, true, {
icon: 'fa-square',
text: Messages.slide_backCol,
@ -369,7 +373,14 @@ define([
hiddenReadOnly: true,
name: 'background',
id: SLIDE_BACKCOLOR_ID
}, function () {
$backgroundPicker.val(backColor);
$backgroundPicker.click();
});
var $foregroundPicker = $('<input>', { type: 'color', value: textColor })
.css({ display: 'none', })
.on('change', function() { updateLocalColors(this.value, undefined); });
var $text = framework._.sfCommon.createButton(null, true, {
icon: 'fa-i-cursor',
text: Messages.slide_textCol,
@ -377,28 +388,15 @@ define([
hiddenReadOnly: true,
name: 'color',
id: SLIDE_COLOR_ID
}, function () {
$foregroundPicker.val(textColor);
$foregroundPicker.click();
});
var $testColor = $('<input>', { type: 'color', value: '!' });
var $check = $("#cp-app-slide-colorpicker");
if ($testColor.attr('type') !== "color" || $testColor.val() === '!') { return; }
var $backgroundPicker = $('<input>', { type: 'color', value: backColor })
.css({ display: 'none', })
.on('change', function() { updateLocalColors(undefined, this.value); });
$check.append($backgroundPicker);
$back.on('click', function() {
$backgroundPicker.val(backColor);
$backgroundPicker.click();
});
var $foregroundPicker = $('<input>', { type: 'color', value: textColor })
.css({ display: 'none', })
.on('change', function() { updateLocalColors(this.value, undefined); });
$check.append($foregroundPicker);
$text.on('click', function() {
$foregroundPicker.val(textColor);
$foregroundPicker.click();
});
framework._.toolbar.$theme.append($text).append($back);
@ -524,6 +522,8 @@ define([
if (newPad) {
colors.updateLocalColors('#000', '#FFF');
} else {
colors.updateLocalColors('#FFF', '#000');
}
CodeMirror.setMode('markdown', function () { });

Loading…
Cancel
Save