GithubHelp home page GithubHelp logo

mxriverlynn / backbone.picky Goto Github PK

View Code? Open in Web Editor NEW
129.0 129.0 29.0 1.42 MB

selectable entities as mixins for Backbone.Model and Backbone.Collection

JavaScript 88.29% CSS 0.89% HTML 10.82%

backbone.picky's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

backbone.picky's Issues

New features: PR or fork?

Hi Derick,

I have added quite a bit of stuff to Backbone.Picky recently, as you perhaps have noticed. I wanted to have these features around for a project of mine, and thought they might be worth sharing.

That said, I realize that they change the character of your project to some extent. It has been simple and dead easy to adapt; the feature set was minimalistic; reading and understanding every aspect of the code took just a couple of minutes. My additions aren't complex by any means, but still, that kind of simplicity is no longer there.

So I wonder which way things should go. I certainly don't want to swamp you with unwanted PRs. If you'd like to pull the changes, that would certainly be great. But I could just as well turn it into an independent repo of my own, rename it for Bower, and keep the new stuff there. (You'd be credited, of course.)

Either way is fine with me. What are your thoughts?

Cheers,

Michael

issue with underscore 1.7.0

It looks like when using Underscore 1.7.0 and Backbone 1.1.2, this plugin breaks. Downgrading to Underscore 1.6.0 fixes the issue.

'selected' event not always passing through the model

Hi Derick,

I've currently implemented backbone.picky in a marionette project and overall it's working great. However I have noticed multiple instances in which the 'selected' event is not passing through a model. I can easily get around this by checking if the model is first defined, but it would be nice if the event ALWAYS passes the selected model through.

Eg:

initialize: ->
  this.listenTo this.collection, 'selected', (selectedModel) ->
    console.log selectedModel // sometimes undefined

Attribute vs member

The docs for this seem to say it will change a "selected" attribute on the model but it seems to only set a member on that instance instead of in the attributes collection via set.

On Backbone.Picky.Selectable:

    select: function () {
      if (this.selected) { return; }

      **this.selected = true;**
      this.trigger("selected");

      if (this.collection) {
        this.collection.select(this);
      }
    },

Is this intentional? I have to override my view serialization to render to pass this every time, so seems undesirable, but maybe I'm missing something?

Is this so that a change event isn't also fired or something? I guess on a fetch you would lose the selection state as well, but that could be handled.

Note about the method name "select"

From the doc:

The Picky collections override the method select on collections. At this point, I can't think of a better name for specifying a model has been selected. Once I find a better name, the API will change.

Instead of select, has pick been considered?

It seems to me like pick is only used on Backbone.Model currently.

document looks like error

the document say it will fire 'select' event. but it indeed fire the selected event. Readme.MD may need to change !

Where'd deselectAll go?

I'm looking in the code after reading the documentation and I can't find deselectAll(). Has there been a change in API?

Installing with bower

It seems that you are the owner of the bower package. I have a problem with it : it installs fine but when I want to use grunt-bower-requirejs, a task that automatically generates the requirejs config file, it gives me an error :

Warning: Ignoring Gruntfile in backbone.picky
You should inform the author to ignore this file in their bower.json

... and backbone-picky is not registred in requirejs-config file.

( Idem for the backbone-syphon package )

I'm building a yeoman generator for marionette based on David Sulk's books. I would really like to generate automatically an out of the box requirejs-config file .

Thanks,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.