浏览代码

Just a update before i go and eat.

Buttons got no functions ;c :cake:
Johand 9 年之前
父节点
当前提交
e2f8af8f7d
共有 2 个文件被更改,包括 29 次插入5 次删除
  1. 24 0
      app/app.js
  2. 5 5
      app/templates/room.html

+ 24 - 0
app/app.js

@@ -229,6 +229,30 @@ if (Meteor.isClient) {
             });
             $("#close-modal").click();
         },
+        "click #smile-modal": function(e){
+            e.preventDefault();
+            if (Session.get("smileClicked")) {
+                $("#smile-modal").removeClass("active");
+                Session.set("smileClicked", false);
+            } else {
+				$("#meh-modal").removeClass("active");
+				Session.set("mehClicked", false);
+                $("#smile-modal").addClass("active");
+                Session.set("smileClicked", true);
+            }
+        },
+        "click #meh-modal": function(e){
+            e.preventDefault();
+            if (Session.get("mehClicked")) {
+                $("#meh-modal").removeClass("active");
+                Session.set("mehClicked", false);
+            } else {
+				$("#smile-modal").removeClass("active");
+				Session.set("smileClicked", false);
+                $("#meh-modal").addClass("active");
+                Session.set("mehClicked", true);
+            }
+        },
         "click #toggle-video": function(e){
             e.preventDefault();
             if (Session.get("mediaHidden")) {

+ 5 - 5
app/templates/room.html

@@ -50,12 +50,12 @@
                         </div>
                         <div class="col-md-3">
                             {{#if currentUser}}
-							<button title="Smile to this song." type="button" id="song-modal" class="btn btn-success btn-lg" data-toggle="modal" data-target="#myModal"><i class="fa fa-smile-o"> 79</i></button>
-                            <button title="I dislike this song." type="button" id="song-modal" class="btn btn-danger btn-lg" data-toggle="modal" data-target="#myModal"><i class="fa fa-meh-o"> 14</i></button>
-							<button title="Report this song!" type="button" id="song-modal" class="btn btn-warning btn-lg" data-toggle="modal" data-target="#myModal"><i class="fa fa-flag"></i></button> 
+							<button title="Smile to this song." type="button" id="smile-modal" class="btn btn-success btn-lg"><i class="fa fa-smile-o"> 79</i></button>
+                            <button title="I dislike this song." type="button" id="meh-modal" class="btn btn-danger btn-lg"><i class="fa fa-meh-o"> 14</i></button>
+							<button title="Report this song!" type="button" id="song-modal" class="btn btn-warning btn-lg"><i class="fa fa-flag"></i></button> 
                             {{else}}
-                            <button title="You need to be logged to smile to this song." type="button" id="song-modal" class="btn btn-success btn-lg" data-toggle="modal" data-target="#myModal" disabled><i class="fa fa-smile-o"> 79</i></button>
-                            <button title="You need to be logge to dislike this song." type="button" id="song-modal" class="btn btn-danger btn-lg" data-toggle="modal" data-target="#myModal" disabled><i class="fa fa-meh-o"> 14</i></button>
+                            <button title="You need to be logged to smile to this song." type="button" id="smile-modal" class="btn btn-success btn-lg" data-toggle="modal" data-target="#myModal" disabled><i class="fa fa-smile-o"> 79</i></button>
+                            <button title="You need to be logged to dislike this song." type="button" id="meh-modal" class="btn btn-danger btn-lg" data-toggle="modal" data-target="#myModal" disabled><i class="fa fa-meh-o"> 14</i></button>
 							<button title="You need to be logged to report this song!" type="button" id="song-modal" class="btn btn-warning btn-lg" data-toggle="modal" data-target="#myModal" disabled><i class="fa fa-flag"></i></button>
 							{{/if}}
                         </div>