diff --git a/src/commands/view/MoveComponent.js b/src/commands/view/MoveComponent.js index c481c02a7..9c47c1d3c 100644 --- a/src/commands/view/MoveComponent.js +++ b/src/commands/view/MoveComponent.js @@ -87,6 +87,7 @@ define(['backbone', './SelectComponent','./SelectPosition'], var utils = this.editor.Utils; if(utils && utils.Sorter) this.sorter = new utils.Sorter({ + editor: this.editor, container: this.$el.get(0), containerSel: '*', itemSel: '*', diff --git a/src/editor/model/Editor.js b/src/editor/model/Editor.js index 38ef30d89..5bed74d2b 100644 --- a/src/editor/model/Editor.js +++ b/src/editor/model/Editor.js @@ -381,10 +381,10 @@ define([ this.UndoManager = this.um; this.set('UndoManager', this.um); key('⌘+z, ctrl+z', function(){ - that.um.undo(); + that.um.undo(true); }); key('⌘+shift+z, ctrl+shift+z', function(){ - that.um.redo(); + that.um.redo(true); }); Backbone.UndoManager.removeUndoType("change"); diff --git a/src/utils/Sorter.js b/src/utils/Sorter.js index 130e7ae22..e07c2693b 100644 --- a/src/utils/Sorter.js +++ b/src/utils/Sorter.js @@ -22,6 +22,7 @@ define(['backbone'], this.direction = o.direction || 'v'; // v (vertical), h (horizontal), a (auto) this.onMoveClb = o.onMove || ''; this.relative = o.relative || 0; + this.editor = o.editor || ''; this.dropContent = ''; }, @@ -383,9 +384,12 @@ define(['backbone'], * */ movePlaceholder: function(plh, dims, pos, trgDim){ var marg = 0, t = 0, l = 0, w = 0, h = 0, - un = 'px', margI = 5, + un = 'px', margI = 5, brdCol = '#62c462', brd = 3, method = pos.method; - var elDim = dims[pos.index]; + var elDim = dims[pos.index];//#62c462 + plh.style.borderColor = 'transparent ' + brdCol; + plh.style.borderWidth = brd + ' ' + (brd + 2); + plh.style.margin = '-' + brd + 'px 0 0'; if(elDim){ // If it's not in flow (like 'float' element) if(!elDim[4]){ @@ -393,6 +397,9 @@ define(['backbone'], h = elDim[2] - (marg * 2) + un; t = elDim[0] + marg; l = (method == 'before') ? (elDim[1] - marg) : (elDim[1] + elDim[3] - marg); + plh.style.borderColor = brdCol + ' transparent'; + plh.style.borderWidth = (brd + 2) + ' ' + brd; + plh.style.margin = '0 0 0 -' + brd + 'px'; }else{ w = elDim[3] + un; h = 'auto'; @@ -460,6 +467,7 @@ define(['backbone'], if(!this.dropContent){ modelTemp = targetCollection.add({}, opts); modelToDrop = model.collection.remove(model); + }else{ modelToDrop = this.dropContent; opts.silent = false; diff --git a/styles/css/main.css b/styles/css/main.css index 389374834..f54188a61 100644 --- a/styles/css/main.css +++ b/styles/css/main.css @@ -2749,12 +2749,20 @@ ol.example li.placeholder:before { position: absolute; z-index: 10; } +.wte-placeholder { + /*border-width: 3px !important;*/ + border-style: solid !important; + border-color: #62c462; + outline: none; } + .wte-placeholder-int, .wte-com-placeholder-int { background-color: #62c462; + box-shadow: 0 0 3px rgba(0, 0, 0, 0.2); height: 100%; width: 100%; pointer-events: 'none'; - padding: 2px; } + padding: 1px; + outline: none; } /********* PANELS **********/ .wte-pn-panel { diff --git a/styles/scss/main.scss b/styles/scss/main.scss index 085f3f405..c6b87a792 100644 --- a/styles/scss/main.scss +++ b/styles/scss/main.scss @@ -222,11 +222,19 @@ ol.example li.placeholder:before {position: absolute;} position: absolute; z-index: 10; } +.#{$app-prefix}placeholder{ + /*border-width: 3px !important;*/ + border-style: solid !important; + border-color: $colorGreen; + outline: none; +} .#{$app-prefix}placeholder-int, .#{$com-prefix}placeholder-int{ background-color: $colorGreen; + box-shadow: 0 0 3px rgba(0, 0, 0, 0.2); height: 100%; width: 100%; pointer-events: 'none'; - padding: 2px; + padding: 1px; + outline: none; } /********* PANELS **********/