Skip to content

Commit

Permalink
Setting disabled_code_sample along with sample_dark_background on new…
Browse files Browse the repository at this point in the history
… components was resetting the options. Resolves #58.
  • Loading branch information
RyanHavoc committed Aug 16, 2016
1 parent af40d29 commit 887be34
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
8 changes: 2 additions & 6 deletions manager/astrum-edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,7 @@ if (group_name) {
}

if (answers.sample_dark_background) {
if(!editedComponent.hasOwnProperty('options')) {
editedComponent.options = {};
}
if(!editedComponent.hasOwnProperty('options')) { editedComponent.options = {}; }
editedComponent.options.sample_dark_background = true;
}

Expand All @@ -245,9 +243,7 @@ if (group_name) {
}

if (answers.disable_code_sample) {
if(!editedComponent.hasOwnProperty('options')) {
editedComponent.options = {};
}
if(!editedComponent.hasOwnProperty('options')) { editedComponent.options = {}; }
editedComponent.options.disable_code_sample = true;
}

Expand Down
6 changes: 4 additions & 2 deletions manager/astrum-new.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,14 @@ if (group_name) {

newComponent.title = answers.title;
if (answers.width != 'full') newComponent.width = answers.width;

if (answers.sample_dark_background) {
newComponent.options = {};
if(!newComponent.hasOwnProperty('options')) { newComponent.options = {} };
newComponent.options.sample_dark_background = answers.sample_dark_background;
}

if (answers.disable_code_sample) {
newComponent.options = {};
if(!newComponent.hasOwnProperty('options')) { newComponent.options = {} };
newComponent.options.disable_code_sample = answers.disable_code_sample;
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "astrum",
"version": "1.6.1",
"version": "1.6.2",
"description": "A lightweight pattern library designed to be included with any web project.",
"main": "./manager/astrum.js",
"scripts": {
Expand Down

0 comments on commit 887be34

Please sign in to comment.