diff --git a/customize.dist/src/less2/include/toolbar.less b/customize.dist/src/less2/include/toolbar.less index 07e5eff61..b6258c4fe 100644 --- a/customize.dist/src/less2/include/toolbar.less +++ b/customize.dist/src/less2/include/toolbar.less @@ -389,11 +389,6 @@ margin: 0; }*/ - .cp-toolbar-rightside-button { - float: right; - cursor: pointer; - } - select { margin-left: 5px; margin-right: 5px; @@ -475,13 +470,6 @@ background-color: @bg-color; } } - .cp-toolbar-rightside { - @media screen and (max-width: @barWidth) { // 450px - flex-wrap: wrap; - height: auto; - width: 100%; - } - } .cp-toolbar-title-hoverable:hover { .cp-toolbar-title-editable, .cp-toolbar-title-edit { cursor: text; @@ -830,13 +818,37 @@ } } .cp-toolbar-rightside { + display: flex; min-height: @toolbar_line-height; overflow: hidden; + @media screen and (max-width: @barWidth) { // 450px + flex-wrap: wrap; + height: auto; + width: 100%; + } &:empty { min-height: 0; height: 0; } - text-align: right; + + .cp-toolbar-rightside-button { + cursor: pointer; + // UI actions + &.cp-toolbar-icon-toggle { order: 1; } + &.cp-toolbar-icon-preview { order: 2; } + &.cp-toolbar-icon-present { order: 3; } + // Content actions + &.cp-toolbar-icon-mediatag { order: 10; } + order: 11; + // Storage actions + &.cp-toolbar-icon-hashtag { order: 20; } + &.cp-toolbar-icon-template { order: 21; } + &.cp-toolbar-icon-forget { order: 22; } + // Drawer + &.cp-toolbar-drawer-button { order: 30; } + + } + .cp-toolbar-drawer-content:empty ~ .cp-toolbar-drawer-button { display: none; } diff --git a/www/code/inner.js b/www/code/inner.js index d10496993..1799819dd 100644 --- a/www/code/inner.js +++ b/www/code/inner.js @@ -102,7 +102,7 @@ define([ class: 'cp-app-code-preview-empty' }).appendTo($previewContainer); - var $previewButton = framework._.sfCommon.createButton(null, true); + var $previewButton = framework._.sfCommon.createButton('preview', true); var forceDrawPreview = function () { try { if (editor.getValue() === '') { @@ -119,12 +119,6 @@ define([ forceDrawPreview(); }, 150); - $previewButton.removeClass('fa-question').addClass('fa-eye'); - window.setTimeout(function () { - // setTimeout needed for tippy (tooltip), otherwise we have the browser's default - // tooltips - $previewButton.attr('title', Messages.previewButtonTitle); - }); var previewTo; $previewButton.click(function () { clearTimeout(previewTo); @@ -377,9 +371,6 @@ define([ if ($preview.length && $preview.is(':visible')) { return $preview[0]; } - if ($codeMirror.length) { - return $codeMirror[0]; - } }; var main = function () { diff --git a/www/common/common-thumbnail.js b/www/common/common-thumbnail.js index f0ba27194..f3864e6a3 100644 --- a/www/common/common-thumbnail.js +++ b/www/common/common-thumbnail.js @@ -177,6 +177,7 @@ define([ window.html2canvas = undefined; Thumb.fromDOM = function (opts, cb) { var element = opts.getContainer(); + if (!element) { return; } var todo = function () { if (opts.filter) { opts.filter(element, true); } window.html2canvas(element, { @@ -202,8 +203,8 @@ define([ var mkThumbnail = function () { var content = opts.getContent(); if (content === oldThumbnailState) { return; } + oldThumbnailState = content; Thumb.fromDOM(opts, function (err, b64) { - oldThumbnailState = content; Thumb.setPadThumbnail(common, opts.href, b64); }); }; diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index c72ea7b07..8bf3474c1 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -468,7 +468,7 @@ define([ switch (type) { case 'export': button = $('