Skip to content

Commit

Permalink
setProperty delegator: Running property comparison through toString
Browse files Browse the repository at this point in the history
  • Loading branch information
anutron committed Nov 4, 2011
1 parent 3874d71 commit ef5c154
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/Delegators/Delegator.SetProperty.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ name: Delegator.SetProperty
var target = link;
if (api.get('target') && api.get('target') != 'self') {
target = link.getElement(api.get('target'));
if (!target) api.fail('could not locate target element to ' + action + ' its class', link);
if (!target) api.fail('could not locate target element to ' + action + ' its property', link);
}
if (action == 'set' || (action == 'toggle' && target.get(api.get('property')) != api.get('value'))){
if (action == 'set' || (action == 'toggle' && target.get(api.get('property')) !== null && target.get(api.get('property')).toString() != 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 ef5c154

Please sign in to comment.