Skip to content

Commit

Permalink
Fix radio input styles
Browse files Browse the repository at this point in the history
  • Loading branch information
artf committed Oct 27, 2017
1 parent ed984a2 commit 0e5c111
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
6 changes: 3 additions & 3 deletions dist/grapes.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
3 changes: 1 addition & 2 deletions src/style_manager/view/PropertyRadioView.js
Original file line number Diff line number Diff line change
Expand Up @@ -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>
`;
},
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/style_manager/view/PropertyView.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
},
Expand Down
4 changes: 2 additions & 2 deletions test/specs/style_manager/view/PropertyRadioView.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 0e5c111

Please sign in to comment.