clone: copy widget's container class

This commit is contained in:
jean-emmanuel 2017-07-30 10:09:24 +02:00
parent 094e2d69bf
commit e55f9da475
2 changed files with 8 additions and 5 deletions

View file

@ -40,6 +40,7 @@ module.exports = class Clone extends _widgets_base {
this.cloneHash = [0]
this.cloneLock = false
this.cloneClass = ''
this.originalHash = false
this.createClone()
@ -63,6 +64,7 @@ module.exports = class Clone extends _widgets_base {
var parsewidgets = require('../../parser').widgets
this.widget.empty()
this.container.removeClass(this.cloneClass)
purge(this.cloneHash)
var widgets = widgetManager.getWidgetById(this.getProp('widgetId'))
@ -74,11 +76,12 @@ module.exports = class Clone extends _widgets_base {
if (this.cloneHash.indexOf(widgets[i].hash) == -1) {
this.originalHash = widgets[i].hash
this.cloneClass = widgets[i].container.attr('class').match(/[^\s]*-container/)[0]
this.container.addClass(this.cloneClass)
var c = parsewidgets([_widgets_base.deepCopy(widgets[i].props)], this.widget, this)
this.widget.find('.widget').addClass('not-editable')
this.container[0].style.setProperty('--color-border', getComputedStyle(c[0]).getPropertyValue('--color-border'))
this.hashes = [this.hash]
if (c[0].abstract.hashes) {

View file

@ -264,15 +264,15 @@
.clone-container {
width: 100rem;
height: 100rem;
border:0;
box-shadow: none;
background: transparent;
.clone {
position: relative;
height: 100%;
width: 100%;
> .widget {
border:0!important;
box-shadow: none!important;
background: transparent!important;
position: relative!important;
left:auto!important;
bottom:auto!important;