added a "minimize" button. popcorn-port
authorhamidouk
Thu, 26 Jan 2012 14:57:36 +0100
branchpopcorn-port
changeset 721 0c53eba54b11
parent 720 08b8b3ce30e4
child 722 ed12570ebd64
added a "minimize" button.
src/css/LdtPlayer.css
src/js/widgets/createAnnotationWidget.js
src/templates/createAnnotationWidget.html
--- a/src/css/LdtPlayer.css	Thu Jan 26 13:01:57 2012 +0100
+++ b/src/css/LdtPlayer.css	Thu Jan 26 14:57:36 2012 +0100
@@ -689,6 +689,15 @@
   color: #D93C71;
 }
 
+.Ldt-createAnnotation-Minimize {
+  position: relative;
+  float: right;
+  height: 17px;
+  width: 17px;
+  right: 0px;
+  top: -5px;
+}
+
 /* AnnotationsListWidget */
 
 .Ldt-AnnotationsListWidget {
--- a/src/js/widgets/createAnnotationWidget.js	Thu Jan 26 13:01:57 2012 +0100
+++ b/src/js/widgets/createAnnotationWidget.js	Thu Jan 26 14:57:36 2012 +0100
@@ -152,9 +152,20 @@
   
   this.selector.find(".Ldt-createAnnotation-submitButton").click(IriSP.wrap(this, this.handleButtonClick));
   
-  if (!this.cinecast_version)
+  if (!this.cinecast_version) {
     this._Popcorn.listen("IriSP.PlayerWidget.AnnotateButton.clicked", 
-                          IriSP.wrap(this, this.handleAnnotateSignal));  
+                          IriSP.wrap(this, this.handleAnnotateSignal));
+    
+    // handle clicks on the cancel button too.
+    this.selector.find(".Ldt-createAnnotation-Minimize").click(IriSP.wrap(this, 
+      function() {
+        // we've got to simulate the pressing of the button because there's no
+        // other way to minimize the widget and show the widgets that were hidden
+        // same time
+        this._Popcorn.trigger("IriSP.PlayerWidget.AnnotateButton.clicked");
+      }
+    ));
+  }
 };
 
 /** handles clicks on the annotate button. Works only for the non-cinecast version */
--- a/src/templates/createAnnotationWidget.html	Thu Jan 26 13:01:57 2012 +0100
+++ b/src/templates/createAnnotationWidget.html	Thu Jan 26 14:57:36 2012 +0100
@@ -7,7 +7,9 @@
         <div class='Ldt-createAnnotation-Title'></div>
         <div class='Ldt-createAnnotation-TimeFrame'></div>
       </div>
-      
+      {{^cinecast_version}}
+      <img src='{{img_dir}}/minimize.png' class='Ldt-createAnnotation-Minimize' alt='Cancel'></img>
+      {{/cinecast_version}}
       <div class='Ldt-createAnnotation-Container'>
         <textarea class='Ldt-createAnnotation-Description'></textarea>
         <div class='Ldt-createAnnotation-profileArrow'>