Browse Source

Update prop clone in layers

up-style-manager
Artur Arseniev 5 years ago
parent
commit
176c10210d
  1. 43
      src/i18n/locale/en.js
  2. 3
      src/style_manager/model/Properties.js

43
src/i18n/locale/en.js

@ -5,7 +5,7 @@ export default {
addButton: 'Add image', addButton: 'Add image',
inputPlh: 'http://path/to/the/image.jpg', inputPlh: 'http://path/to/the/image.jpg',
modalTitle: 'Select Image', modalTitle: 'Select Image',
uploadTitle: 'Drop files here or click to upload' uploadTitle: 'Drop files here or click to upload',
}, },
// Here just as a reference, GrapesJS core doesn't contain any block, // Here just as a reference, GrapesJS core doesn't contain any block,
// so this should be omitted from other local files // so this should be omitted from other local files
@ -15,7 +15,7 @@ export default {
}, },
categories: { categories: {
// 'category-id': 'Category Label', // 'category-id': 'Category Label',
} },
}, },
domComponents: { domComponents: {
names: { names: {
@ -33,8 +33,8 @@ export default {
thead: 'Table head', thead: 'Table head',
table: 'Table', table: 'Table',
row: 'Table row', row: 'Table row',
cell: 'Table cell' cell: 'Table cell',
} },
}, },
deviceManager: { deviceManager: {
device: 'Device', device: 'Device',
@ -42,8 +42,8 @@ export default {
desktop: 'Desktop', desktop: 'Desktop',
tablet: 'Tablet', tablet: 'Tablet',
mobileLandscape: 'Mobile Landscape', mobileLandscape: 'Mobile Landscape',
mobilePortrait: 'Mobile Portrait' mobilePortrait: 'Mobile Portrait',
} },
}, },
panels: { panels: {
buttons: { buttons: {
@ -55,9 +55,9 @@ export default {
'open-sm': 'Open Style Manager', 'open-sm': 'Open Style Manager',
'open-tm': 'Settings', 'open-tm': 'Settings',
'open-layers': 'Open Layer Manager', 'open-layers': 'Open Layer Manager',
'open-blocks': 'Open Blocks' 'open-blocks': 'Open Blocks',
} },
} },
}, },
selectorManager: { selectorManager: {
label: 'Classes', label: 'Classes',
@ -66,8 +66,8 @@ export default {
states: { states: {
hover: 'Hover', hover: 'Hover',
active: 'Click', active: 'Click',
'nth-of-type(2n)': 'Even/Odd' 'nth-of-type(2n)': 'Even/Odd',
} },
}, },
styleManager: { styleManager: {
empty: 'Select an element before using Style Manager', empty: 'Select an element before using Style Manager',
@ -80,12 +80,15 @@ export default {
decorations: 'Decorations', decorations: 'Decorations',
extra: 'Extra', extra: 'Extra',
flex: 'Flex', flex: 'Flex',
dimension: 'Dimension' dimension: 'Dimension',
}, },
// The core library generates the name by their `property` name // The core library generates the name by their `property` name
properties: { properties: {
// float: 'Float', 'text-shadow-h': 'X',
} 'text-shadow-v': 'Y',
'text-shadow-blur': 'Blur',
'text-shadow-color': 'Color',
},
// Translate options in style properties // Translate options in style properties
// options: { // options: {
// float: { // Id of the property // float: { // Id of the property
@ -110,15 +113,15 @@ export default {
id: traitInputAttr, id: traitInputAttr,
alt: traitInputAttr, alt: traitInputAttr,
title: traitInputAttr, title: traitInputAttr,
href: { placeholder: 'eg. https://google.com' } href: { placeholder: 'eg. https://google.com' },
}, },
// In a trait like select, these are used to translate option names // In a trait like select, these are used to translate option names
options: { options: {
target: { target: {
false: 'This window', false: 'This window',
_blank: 'New window' _blank: 'New window',
} },
} },
} },
} },
}; };

3
src/style_manager/model/Properties.js

@ -113,11 +113,14 @@ export default Backbone.Collection.extend(TypeableCollection).extend({
], ],
deepClone() { deepClone() {
const { em } = this;
const collection = this.clone(); const collection = this.clone();
collection.em = em;
collection.reset( collection.reset(
collection.map(model => { collection.map(model => {
const cloned = model.clone(); const cloned = model.clone();
cloned.typeView = model.typeView; cloned.typeView = model.typeView;
cloned.em = em;
return cloned; return cloned;
}) })
); );

Loading…
Cancel
Save