Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Sosinski committed Mar 28, 2012
1 parent 607f96c commit 3c9467b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
3 changes: 2 additions & 1 deletion app/views/admin/stats/index.html.erb
Expand Up @@ -37,6 +37,7 @@
<!-- ------------------------------------------------------------------------------------------ -->
</div>


<% content_for :bindings do %>
ko.applyBindings(Admin.statsViewModel = new Admin.StatsViewModel(), ko.element("stats"));
ko.applyBindings(Admin.statsViewModel = new Admin.StatsViewModel(), ko.element("stats-view"));
<% end %>
4 changes: 1 addition & 3 deletions app/views/root/lists/show.html.erb
Expand Up @@ -6,14 +6,13 @@
<span data-bind="visible: incompleteTasks().length > 0">
has <span data-bind="text: incompleteTasks().length"></span> <span data-bind="text: incompleteTasks().length == 1 ? 'task' : 'tasks'"></span> left
</span>

<span data-bind="visible: incompleteTasks().length == 0">is complete</span>
</small>
</h1>
</div>

<div class="control-group">

<form id="new-task" data-bind="submit: createTask">
<span class="input-prepend">
<a href="#" class="add-on btn" data-bind="click: createTask"><i class="icon-plus"></i></a>
Expand All @@ -24,7 +23,6 @@
</div>
</span>
</form>

</div>

<div id="tasks" class="control-group" data-bind="foreach: tasks">
Expand Down
9 changes: 8 additions & 1 deletion lib/assets/javascripts/ko.js
Expand Up @@ -2,7 +2,14 @@
//= require_self

ko.element = function(id) {
return document.getElementById(id);
var element = document.getElementById(id);

if (element) {
return document.getElementById(id);
}
else {
throw('Element with id "' + id + '" could not be found');
}
};

ko.validation.init({insertMessages: false});

0 comments on commit 3c9467b

Please sign in to comment.