From 552f34e94e8732719cec35d4906141b99261b34f Mon Sep 17 00:00:00 2001 From: jiyinyiyong Date: Fri, 14 Mar 2014 10:04:44 +0800 Subject: [PATCH] future has focus too --- coffee/menu.coffee | 3 +++ make.coffee | 3 ++- view/menu.jade | 11 ++++++----- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/coffee/menu.coffee b/coffee/menu.coffee index 301aba1..159678b 100644 --- a/coffee/menu.coffee +++ b/coffee/menu.coffee @@ -40,5 +40,8 @@ app.menu = new Vue doFocus: (index) -> taskList = @$data.working.splice index, 1 @$data.working.unshift taskList[0] + doFocusFutures: (index) -> + taskList = @$data.futures.splice index, 1 + @$data.futures.unshift taskList[0] doRemove: (index) -> @$data.working.splice index, 1 diff --git a/make.coffee b/make.coffee index 08a517a..18a9b70 100644 --- a/make.coffee +++ b/make.coffee @@ -12,7 +12,8 @@ target.dev = -> exec 'pkill -f doodle', -> command 'doodle index.html build/build.js log:yes' fs.watch 'view', interva: 300, -> - exec 'jade -o ./ view/index.jade' + exec 'jade -o ./ view/index.jade', -> + station.reload 'repo/todolist' fs.watch 'coffee', interval: 300, (type, filename) -> if type in ['create', 'change'] exec "coffee -o src/ -bc coffee/#{filename}" diff --git a/view/menu.jade b/view/menu.jade index 383b121..b72e97f 100644 --- a/view/menu.jade +++ b/view/menu.jade @@ -11,7 +11,8 @@ .title(v-model='title') .content(v-model='content') .handlers - span.button.do-working(v-on='click: doWork($index)') work + span.button(v-on='click: doFocusFutures($index)') focus + span.button(v-on='click: doWork($index)') work .empty(v-show='futures.length == 0') span futures is empty @@ -27,10 +28,10 @@ .title(v-model='title', contenteditable, v-focus-editable) .content(v-model='content', contenteditable) .handlers - span.button.do-futures(v-on='click: doFocus($index)') focus - span.button.do-futures(v-on='click: doFutures($index)') futures - span.button.do-history(v-on='click: doHistory($index)') history - span.button.do-history(v-on='click: doRemove($index)') remove + span.button(v-on='click: doFocus($index)') focus + span.button(v-on='click: doFutures($index)') futures + span.button(v-on='click: doHistory($index)') history + span.button(v-on='click: doRemove($index)') remove .empty(v-show='working.length == 0') span working is empty