Commit bc936e82 authored by Sindre Sorhus's avatar Sindre Sorhus

Merge pull request #425 from passy/plastron-fix

PlastronJS: Fixed item rendering
parents dd92c429 ee9537a6
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -2,6 +2,7 @@
goog.provide('todomvc.todocontrol');
goog.require('goog.dom');
goog.require('goog.string');
goog.require('goog.events.KeyCodes');
goog.require('mvc.Control');
goog.require('todomvc.templates');
......@@ -44,13 +45,29 @@ todomvc.todocontrol.prototype.enterDocument = function() {
// Toggle complete
this.autobind('.toggle', '{$completed}');
// Change li class on completion
this.autobind('', {
reqs: ['completed'],
onClass: 'completed',
noClick: true
});
// Delete the model
this.click(function() {
model.dispose();
}, '.destroy');
// keep label inline with title
this.autobind( 'label', '{$title}' );
this.autobind( 'label', {
reqs: ['title'],
template: function (data) { return data.title; },
data: {
title: function (control) {
var value = control.getModel().get('title');
return goog.string.htmlEscape(value);
}
}
});
var inputEl = this.getEls('.edit')[0];
// Dblclick to edit
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -3,7 +3,7 @@
"inputs": "js/app.js",
"paths": ["js/", "template/"],
"output-wrapper": "(function(){%output%})();",
"mode": "ADVANCED",
"mode": "SIMPLE",
"level": "VERBOSE",
"output-file": "js/compiled.js"
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment