New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attributes didn't use observe's value #1

Closed
eddie168 opened this Issue Sep 18, 2012 · 1 comment

Comments

Projects
None yet
2 participants
@eddie168

eddie168 commented Sep 18, 2012

Thanks so much for the great plugin, it is really useful. There is a bug that I found for attributes in bindings. Sorry I didn't do a pull requests but here is the patch:

*** backbone.stickit.js Tue Sep 18 15:39:16 2012
--- backbone.stickit.new.js Tue Sep 18 15:39:27 2012
***************
*** 64,70 ****
                                  _.each(attributes, function(attrConfig) {
                                          var lastClass = '',
                                                  updateAttr = function() {
!                                                         var val = applyViewFn(self, attrConfig.format) || model.get(modelAttr);
                                                          // If it is a class then we need to remove the last value and add the new.
                                                          if (attrConfig.name == 'class') {
                                                                  $el.removeClass(lastClass).addClass(val);
--- 64,70 ----
                                  _.each(attributes, function(attrConfig) {
                                          var lastClass = '',
                                                  updateAttr = function() {
!                                                         var val = applyViewFn(self, attrConfig.format, model.get(attrConfig.observe)) || model.get(modelAttr);
                                                          // If it is a class then we need to remove the last value and add the new.
                                                          if (attrConfig.name == 'class') {
                                                                  $el.removeClass(lastClass).addClass(val);
@delambo

This comment has been minimized.

Show comment
Hide comment
@delambo

delambo Sep 18, 2012

Member

@eddie168 Thanks for the heads up. I cleaned that up, and more. You can find the fix on master.

Member

delambo commented Sep 18, 2012

@eddie168 Thanks for the heads up. I cleaned that up, and more. You can find the fix on master.

@delambo delambo closed this Sep 18, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment