Browse Source

Fix radio input styles

pull/487/head
Artur Arseniev 8 years ago
parent
commit
0e5c111b0c
  1. 6
      dist/grapes.min.js
  2. 2
      package.json
  3. 3
      src/style_manager/view/PropertyRadioView.js
  4. 2
      src/style_manager/view/PropertyView.js
  5. 4
      test/specs/style_manager/view/PropertyRadioView.js

6
dist/grapes.min.js

File diff suppressed because one or more lines are too long

2
package.json

@ -1,7 +1,7 @@
{
"name": "grapesjs",
"description": "Free and Open Source Web Builder Framework",
"version": "0.12.17",
"version": "0.12.19",
"author": "Artur Arseniev",
"license": "BSD-3-Clause",
"homepage": "http://grapesjs.com",

3
src/style_manager/view/PropertyRadioView.js

@ -5,7 +5,6 @@ module.exports = require('./PropertyView').extend({
const ppfx = this.ppfx;
return `
<div class="${ppfx}field ${ppfx}field-radio">
<span id="${pfx}input-holder"></span>
</div>
`;
},
@ -35,7 +34,7 @@ module.exports = require('./PropertyView').extend({
`;
});
const inputHld = this.el.querySelector(`#${pfx}input-holder`);
const inputHld = this.el.querySelector(`.${ppfx}field`);
inputHld.innerHTML = `<div class="${ppfx}radio-items">${inputStr}</div>`;
this.input = inputHld.firstChild;
}

2
src/style_manager/view/PropertyView.js

@ -152,7 +152,7 @@ module.exports = Backbone.View.extend({
* the value of the model which will propogate those changes to the target
*/
inputValueChanged(e) {
e.stopPropagation();
e && e.stopPropagation();
this.model.set('value', this.getInputValue());
this.elementUpdated();
},

4
test/specs/style_manager/view/PropertyRadioView.js

@ -67,12 +67,12 @@ module.exports = {
});
it('Options rendered', () => {
var input = view.el.querySelector('#input-holder').firstChild;
var input = view.el.querySelector('.field').firstChild;
expect(input.children.length).toEqual(options.length);
});
it('Options rendered correctly', () => {
var children = view.el.querySelector('#input-holder').firstChild.children;
var children = view.el.querySelector('.field').firstChild.children;
expect(children[0].querySelector('label').textContent).toEqual('test1value');
expect(children[1].querySelector('label').textContent).toEqual('test2');
expect(children[0].querySelector('input').value).toEqual(options[0].value);

Loading…
Cancel
Save