Skip to content
Browse files

refactoring timeline

  • Loading branch information...
1 parent 7c4329d commit d91fa193ea010bfee6a78e2e8023bb4dfc48bea9 @amesel amesel committed
Showing with 18 additions and 11 deletions.
  1. +0 −11 app/assets/javascripts/parties.js.coffee
  2. +18 −0 app/views/parties/show.html.haml
View
11 app/assets/javascripts/parties.js.coffee
@@ -1,19 +1,8 @@
$ ->
- h = $(".end").data("hour")
- m = $(".end").data("min")
- t = new Timer(h, m)
- t.start()
$('#party_member_tokens').tokenInput '/users.json',
hintText: 'メンバーを選択してください'
theme: 'facebook'
$('.best_in_place').best_in_place()
- $('.end .best_in_place').live 'ajax:success', (event, data, status, xhr) ->
- console.log(data)
- json = $.parseJSON(data)
- $(".end").attr("data-hour", json.end_hour).attr("data-min", json.end_min)
- t.stop()
- t = new Timer(json.end_hour, json.end_min)
- t.start()
$("#global").css "height", $(window).height()
$("#main").css "height", $(window).height()
View
18 app/views/parties/show.html.haml
@@ -1,3 +1,21 @@
+:javascript
+ $(function(){
+ var h, m, t;
+ h = $(".end").data("hour");
+ m = $(".end").data("min");
+ t = new Timer(h, m);
+ t.start();
+ $('.end .best_in_place').live('ajax:success', function(event, data, status, xhr) {
+ var json;
+ console.log(data);
+ json = $.parseJSON(data);
+ $(".end").attr("data-hour", json.end_hour).attr("data-min", json.end_min);
+ t.stop();
+ t = new Timer(json.end_hour, json.end_min);
+ return t.start();
+ });
+ });
+
- content_for :header do
- if notice
#notice

0 comments on commit d91fa19

Please sign in to comment.
Something went wrong with that request. Please try again.