Commits

Esa-Matti Suuronen committed 2a4e6c0

usability improvements.

Comments (0)

Files changed (3)

     font-family: 'Yanone Kaffeesatz', serif;
     color: black;
     background: url("../img/beer.png") no-repeat center;
-    text-shadow: white 5px 5px 5px;
+    text-shadow: white 1px 5px 5px;
 }
 
 
                     </fieldset>
                 </form>
             </div>
+
+
+        <div id="dialog-confirm" title="Delete all Drinkers?">
+	<p>
+            These Drinkers will be permanently deleted and cannot be recovered. Are you sure?
+        </p>
+        </div>
+
         <div id="menu">
-            <button> Add a new drinker! </button>
+            <button id="addDrinker"> Add a new drinker! </button>
+            <button id="reset"> reset</button>
         </div>
 
         </div>

js/juomalaskuri.js

     $("#dialog-form").dialog({
                         autoOpen: false,
                         height: 250,
+                        width: 300,
                         draggable: true,
-                        width: 300,
                         modal: true,
                         buttons: {
                                 'Add!': addDrinkerFromForm,
                 });
 
 
+    $("#dialog-confirm").dialog({
+            autoOpen: false,
+            resizable: false,
+            height: 250,
+            width: 300,
+            modal: true,
+            buttons: {
+                    'Delete all drinkers': function() {
+                            window.location.hash = "reset";
+                            window.location.reload();
+                    },
+                    Cancel: function() {
+                            $(this).dialog('close');
+                    }
+            }
+    });
+
+
     var openForm = function(){
          $("#dialog-form").dialog('open');
          $(window).bind("keypress", keyboardListener);
     };
 
 
+
+
+
     if (_.isEmpty(drinkers)) {
-        $(window).one("click", openForm);
+        openForm();
     }
 
-    $("button").click(openForm);
-
+    $("#addDrinker").click(openForm);
+    $("#reset").click(function(){
+        $("#dialog-confirm").dialog("open");
+    });