Add fixed order for rightside icons in the toolbar
This commit is contained in:
@@ -73,9 +73,7 @@ define([
|
||||
};
|
||||
|
||||
var mkSlidePreviewPane = function (framework, $contentContainer) {
|
||||
var $previewButton = framework._.sfCommon.createButton(null, true);
|
||||
$previewButton.removeClass('fa-question').addClass('fa-eye');
|
||||
$previewButton.attr('title', Messages.previewButtonTitle);
|
||||
var $previewButton = framework._.sfCommon.createButton('preview', true);
|
||||
$previewButton.click(function () {
|
||||
var $c = $contentContainer;
|
||||
if ($c.hasClass('cp-app-slide-preview')) {
|
||||
@@ -102,19 +100,16 @@ define([
|
||||
});
|
||||
};
|
||||
|
||||
var mkPrintButton = function (framework, editor, $content, $print, $toolbarDrawer) {
|
||||
var $printButton = $('<button>', {
|
||||
title: Messages.printButtonTitle,
|
||||
'class': 'cp-toolbar-rightside-button fa fa-print',
|
||||
style: 'font-size: 17px'
|
||||
}).click(function () {
|
||||
var mkPrintButton = function (framework, editor, $content, $print) {
|
||||
var $printButton = framework._.sfCommon.createButton('print', true);
|
||||
$printButton.click(function () {
|
||||
Slide.update(editor.getValue(), true);
|
||||
$print.html($content.html());
|
||||
window.focus();
|
||||
window.print();
|
||||
framework.feedback('PRINT_SLIDES');
|
||||
}).append($('<span>', {'class': 'cp-toolbar-drawer-element'}).text(Messages.printText));
|
||||
$toolbarDrawer.append($printButton);
|
||||
});
|
||||
framework._.toolbar.$drawer.append($printButton);
|
||||
};
|
||||
|
||||
// Flag to check if a file from the filepicker is a mediatag for the slides or a background image
|
||||
@@ -122,7 +117,7 @@ define([
|
||||
isBackground: false
|
||||
};
|
||||
|
||||
var mkSlideOptionsButton = function (framework, slideOptions, $toolbarDrawer) {
|
||||
var mkSlideOptionsButton = function (framework, slideOptions) {
|
||||
var metadataMgr = framework._.cpNfInner.metadataMgr;
|
||||
var updateSlideOptions = function (newOpt) {
|
||||
if (JSONSortify(newOpt) !== JSONSortify(slideOptions)) {
|
||||
@@ -319,14 +314,17 @@ define([
|
||||
return $container;
|
||||
};
|
||||
|
||||
var $slideOptions = $('<button>', {
|
||||
var $optionsButton = framework._.sfCommon.createButton(null, true, {
|
||||
icon: 'fa-cog',
|
||||
title: Messages.slideOptionsTitle,
|
||||
'class': 'cp-toolbar-rightside-button fa fa-cog cp-hidden-if-readonly',
|
||||
style: 'font-size: 17px'
|
||||
}).click(function () {
|
||||
hiddenReadOnly: true,
|
||||
text: Messages.slideOptionsText,
|
||||
name: 'options'
|
||||
});
|
||||
$optionsButton.click(function () {
|
||||
$('body').append(createPrintDialog());
|
||||
}).append($('<span>', {'class': 'cp-toolbar-drawer-element'}).text(Messages.slideOptionsText));
|
||||
$toolbarDrawer.append($slideOptions);
|
||||
});
|
||||
framework._.toolbar.$drawer.append($optionsButton);
|
||||
|
||||
metadataMgr.onChange(function () {
|
||||
var md = metadataMgr.getMetadata();
|
||||
@@ -363,17 +361,21 @@ define([
|
||||
framework.localChange();
|
||||
};
|
||||
|
||||
var $back = $('<button>', {
|
||||
id: SLIDE_BACKCOLOR_ID,
|
||||
'class': 'fa fa-square cp-toolbar-rightside-button cp-hidden-if-readonly',
|
||||
'style': 'font-family: FontAwesome; color: #000;',
|
||||
title: Messages.backgroundButtonTitle
|
||||
var $back = framework._.sfCommon.createButton(null, true, {
|
||||
icon: 'fa-square',
|
||||
title: Messages.backgroundButtonTitle,
|
||||
hiddenReadOnly: true,
|
||||
name: 'background',
|
||||
style: 'color: #000;',
|
||||
id: SLIDE_BACKCOLOR_ID
|
||||
});
|
||||
var $text = $('<button>', {
|
||||
id: SLIDE_COLOR_ID,
|
||||
'class': 'fa fa-i-cursor cp-toolbar-rightside-button cp-hidden-if-readonly',
|
||||
'style': 'font-family: FontAwesome; font-weight: bold; color: #fff;',
|
||||
title: Messages.colorButtonTitle
|
||||
var $text = framework._.sfCommon.createButton(null, true, {
|
||||
icon: 'fa-i-cursor',
|
||||
title: Messages.colorButtonTitle,
|
||||
hiddenReadOnly: true,
|
||||
name: 'color',
|
||||
style: 'font-weight: bold; color: #FFF;',
|
||||
id: SLIDE_COLOR_ID
|
||||
});
|
||||
var $testColor = $('<input>', { type: 'color', value: '!' });
|
||||
var $check = $("#cp-app-slide-colorpicker");
|
||||
@@ -471,7 +473,7 @@ define([
|
||||
|
||||
activateLinks($content, framework);
|
||||
Slide.setModal(framework._.sfCommon, $modal, $content, slideOptions, Messages.slideInitialState);
|
||||
mkPrintButton(framework, editor, $content, $print, $toolbarDrawer);
|
||||
mkPrintButton(framework, editor, $content, $print);
|
||||
mkSlideOptionsButton(framework, slideOptions, $toolbarDrawer);
|
||||
mkColorConfiguration(framework, $modal);
|
||||
mkFilePicker(framework, editor);
|
||||
@@ -559,9 +561,6 @@ define([
|
||||
if ($c.hasClass('cp-app-slide-preview')) {
|
||||
return $('.cp-app-slide-frame').first()[0];
|
||||
}
|
||||
if ($codeMirror.length) {
|
||||
return $codeMirror[0];
|
||||
}
|
||||
};
|
||||
|
||||
var main = function () {
|
||||
|
||||
Reference in New Issue
Block a user