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 @@ ...@@ -2,6 +2,7 @@
goog.provide('todomvc.todocontrol'); goog.provide('todomvc.todocontrol');
goog.require('goog.dom'); goog.require('goog.dom');
goog.require('goog.string');
goog.require('goog.events.KeyCodes'); goog.require('goog.events.KeyCodes');
goog.require('mvc.Control'); goog.require('mvc.Control');
goog.require('todomvc.templates'); goog.require('todomvc.templates');
...@@ -44,13 +45,29 @@ todomvc.todocontrol.prototype.enterDocument = function() { ...@@ -44,13 +45,29 @@ todomvc.todocontrol.prototype.enterDocument = function() {
// Toggle complete // Toggle complete
this.autobind('.toggle', '{$completed}'); this.autobind('.toggle', '{$completed}');
// Change li class on completion
this.autobind('', {
reqs: ['completed'],
onClass: 'completed',
noClick: true
});
// Delete the model // Delete the model
this.click(function() { this.click(function() {
model.dispose(); model.dispose();
}, '.destroy'); }, '.destroy');
// keep label inline with title // 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]; var inputEl = this.getEls('.edit')[0];
// Dblclick to edit // 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 @@ ...@@ -3,7 +3,7 @@
"inputs": "js/app.js", "inputs": "js/app.js",
"paths": ["js/", "template/"], "paths": ["js/", "template/"],
"output-wrapper": "(function(){%output%})();", "output-wrapper": "(function(){%output%})();",
"mode": "ADVANCED", "mode": "SIMPLE",
"level": "VERBOSE", "level": "VERBOSE",
"output-file": "js/compiled.js" "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