fixed rebase bugs with weird ids

This commit is contained in:
Peter Cottle 2012-10-30 22:33:25 -07:00
parent 23e86e5105
commit 866749bad5
3 changed files with 7 additions and 10 deletions

View file

@ -99,7 +99,7 @@
Rebasing <%= num %> Commits Rebasing <%= num %> Commits
</p> </p>
<p class="helperText"> <p class="helperText">
(Drag and drop to re-order, and toggle the "pick" button to drop / re-add commits) (Drag and drop to re-order. Toggling the "pick" button to omit or re-add a commit)
</p> </p>
<div id="entryHolders"> <div id="entryHolders">
<ul id="rebaseEntries"> <ul id="rebaseEntries">
@ -121,7 +121,7 @@
<%= id %> <%= id %>
</span> </span>
<a id="toggleButton" class="uiButton uiButtonPink"> <a id="toggleButton" class="uiButton uiButtonPink">
Toggle Pick Pick
</a> </a>
</div> </div>
</li> </li>

View file

@ -133,14 +133,13 @@ var RebaseEntryView = Backbone.View.extend({
}, },
render: function() { render: function() {
var json = this.model.toJSON();
this.$el.append(this.template(this.model.toJSON())); this.$el.append(this.template(this.model.toJSON()));
// have to build some of this stuff up manually, lame. // hacky :( who would have known jquery barfs on ids with %'s and quotes
// backbone needs a collectionview, this is ugly this.listEntry = this.$el.children(':last');
var id = '#' + this.model.get('id');
this.listEntry = this.$(id);
this.$(id + ' #toggleButton').on('click', _.bind(function() { this.listEntry.delegate('#toggleButton', 'click', _.bind(function() {
this.toggle(); this.toggle();
}, this)); }, this));
} }

View file

@ -15,8 +15,6 @@ Small things to implement:
Minor Bugs to fix: Minor Bugs to fix:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
jQuery gets confused with ids like #C1''.... ?
Big Bugs to fix: Big Bugs to fix:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~