Skip to content

Commit

Permalink
[Prepublish] CSS changes to get the black alert style + included juli…
Browse files Browse the repository at this point in the history
…ancwirko#44 changes (update)
  • Loading branch information
vetterh1 committed Jul 19, 2017
1 parent 13df013 commit 3f5d884
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dist/SAlert.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,11 @@
value: function success(msg, data) {
return insertFunc(msg, data, 'success');
}
}, {
key: 'update',
value: function update(id, customFields) {
_sAlertStore2.default.dispatch({ type: 'UPDATE', data: { id: id, customFields: customFields } });
}
}, {
key: 'close',
value: function close(id) {
Expand Down
17 changes: 17 additions & 0 deletions dist/s-alert-parts/s-alert-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,21 @@
return [].concat(_toConsumableArray(state), [action.data]);
};

var update = function update(state, action) {
var elemToUpdateArray = state.slice().filter(function (item) {
return item.id === action.data.id;
});
if (Array.isArray(elemToUpdateArray)) {
var elemToUpdateIndex = state.indexOf(elemToUpdateArray[0]);
if (elemToUpdateIndex > -1) {
state[elemToUpdateIndex].customFields = action.data.customFields;
return [].concat(_toConsumableArray(state));
}
return state;
}
return state;
};

var remove = function remove(state, action) {
var elemToRemoveArray = state.slice().filter(function (item) {
return item.id === action.data.id;
Expand All @@ -79,6 +94,8 @@
switch (action.type) {
case 'INSERT':
return insert(state, action);
case 'UPDATE':
return update(state, action);
case 'REMOVE':
return remove(state, action);
case 'REMOVEALL':
Expand Down

0 comments on commit 3f5d884

Please sign in to comment.