challenges: list taken dynamically from scope so we can push/unshift to various task lists depending on location of add-task form. be careful with this commit, not the {{}} instead of {} - seems to be required otherwise things get weird

This commit is contained in:
Tyler Renelle
2013-05-12 13:36:30 +01:00
parent 0a37637daf
commit d28edaf30d
2 changed files with 10 additions and 5 deletions
+9 -4
View File
@@ -135,10 +135,15 @@
{{#if equal(@type,'todo')}}<div id="todos-chart" class="hidden"></div>{{/}}
{{#if @editable}}
<form class="addtask-form form-inline new-task-form {#if and(_showCompleted,equal(@type,'todo'))}hidden{/}" id="new-{{@type}}" data-task-type="{{@type}}" x-bind="submit:addTask">
<span class="addtask-field"><input value="{@inputValue}" type="text" placeholder="{{@placeHolder}}"/></span>
<input class="addtask-btn" type="submit" value="">
</form>
<!-- need {#with} so we can reference model.at() in the submit handler -->
<!-- NOTE: static binding {{}} seems to be required, otherwise things get weird - e.at() is _habitList first time, _habitList.0 second time, etc -->
{{#with @list}}
<form class="addtask-form form-inline new-task-form {#if and(_showCompleted,equal(@type,'todo'))}hidden{/}" data-task-type="{{@type}}" x-bind="submit:addTask">
<span class="addtask-field"><input value="{@inputValue}" type="text" placeholder="{{@placeHolder}}"/></span>
<input class="addtask-btn" type="submit" value="">
</form>
{{/}}
<hr>
{{/}}
<ul class="{{@type}}s {#unless @list}hidden{/}">