Skip to content

Commit

Permalink
reworking setProperty delegator for start values being null
Browse files Browse the repository at this point in the history
  • Loading branch information
anutron committed Nov 4, 2011
1 parent ef5c154 commit fd7b025
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Source/Delegators/Delegator.SetProperty.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ name: Delegator.SetProperty
target = link.getElement(api.get('target'));
if (!target) api.fail('could not locate target element to ' + action + ' its property', link);
}
if (action == 'set' || (action == 'toggle' && target.get(api.get('property')) !== null && target.get(api.get('property')).toString() != api.get('value'))){
var current = target.get(api.get('property'));
if (current !== null) current = current.toString();
if (action == 'set' || (action == 'toggle' && current != api.get('value'))){
if (api.get('value') === null) api.fail('Could not retrieve eraseproperty-value option from element.');
target.set(api.get('property'), api.get('value'));
} else {
Expand Down

0 comments on commit fd7b025

Please sign in to comment.