Re-working virtual shelves interface to try to make it cleaner and make the steps...
authorOwen Leonard <oleonard@myacpl.org>
Mon, 29 Oct 2007 21:44:59 +0000 (16:44 -0500)
committerJoshua Ferraro <jmf@liblime.com>
Mon, 29 Oct 2007 21:47:40 +0000 (16:47 -0500)
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc

index 0750fb2..6594084 100644 (file)
@@ -5,7 +5,7 @@
        // prepare DOM for YUI Toolbar
 
         $(document).ready(function() {
-               // $("#deleteshelfc").empty();
+               $("#deleteshelfc").empty();
            yuiToolbar();
         });
 
        function yuiToolbar() {
                    newshelfButton = new YAHOO.widget.Button("newshelf");
                    editshelfButton = new YAHOO.widget.Button("editshelf");
-                       deleteshelfButton = new YAHOO.widget.Button("deleteshelf", { value: "deleteshelfvalue" });
-                       YAHOO.util.Event.on("deleteshelf_f", "submit", confirmDelete);
+                       deleteshelfButton = new YAHOO.widget.Button({
+                                            id: "deleteshelf", 
+                                            type: "button", 
+                                            label: "Delete Shelf", 
+                                            container: "deleteshelfc",
+                                                                                       onclick: {fn:function(){confirmDelete("Are you sure you want to delete this shelf?")}}
+                                        });
        }
-        function confirmDelete(p_oEvent) {
-            var bSubmit = window.confirm("Are you sure you want to delete this shelf?");
-            if(!bSubmit) {
-                YAHOO.util.Event.preventDefault(p_oEvent);
-            }
-        }
 
        //]]>
        </script>
 <ul class="toolbar">
 
        <li><a id="newshelf" href="/cgi-bin/koha/virtualshelves/shelves.pl?shelves=1">New Shelf</a></li>
-       <!-- TMPL_IF NAME="viewshelf" --><!-- TMPL_IF name="manageshelf" --><li><a id="editshelf" href="/cgi-bin/koha/virtualshelves/shelves.pl?op=modif&amp;shelf=<!-- TMPL_VAR NAME="shelfnumber" -->">Edit Shelf</a></li><li id="deleteshelfc"><form action="/cgi-bin/koha/virtualshelves/shelves.pl" method="post" id="deleteshelf_f">
-<input type="hidden" name="DEL-<!-- TMPL_VAR NAME="shelfnumber" -->" />
-<input type="hidden" name="shelves" value="1" />
-<input type="submit" id="deleteshelf" value="Delete Shelf" onclick="return confirmDelete('Are you sure you want to delete this shelf?')" /></form>
-</li>
-
-<!-- /TMPL_IF --><!-- /TMPL_IF -->
+       <!-- TMPL_IF NAME="viewshelf" --><!-- TMPL_IF name="manageshelf" --><li><a id="editshelf" href="/cgi-bin/koha/virtualshelves/shelves.pl?op=modif&amp;shelf=<!-- TMPL_VAR NAME="shelfnumber" -->">Edit Shelf</a></li><li id="deleteshelfc"><a id="deleteshelf" href="/cgi-bin/koha/virtualshelves/shelves.pl?shelves=1&amp;DEL-<!-- TMPL_VAR NAME="shelfnumber" -->=1">Delete Shelf</a></li><!-- /TMPL_IF --><!-- /TMPL_IF -->
 </ul></div>