Created
June 13, 2013 18:02
-
-
Save aleksclark/5775880 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
self.permConstructor = function(perm) { | |
return ko.computed({ | |
read: function(){self.hasPerm(perm)}, | |
write: function(val){ | |
if (val) { | |
self.permissions.push(perm); | |
} else { | |
self.permissions.remove(perm); | |
} | |
} | |
}); | |
} | |
self.presenter = self.permConstructor('canvas'); | |
self.sendAudio = self.permConstructor('audio'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment