Enhancement: Some JS to remove dialog after 5 sec
authorChris Nighswonger <cnighswonger@foundations.edu>
Tue, 12 Jan 2010 14:31:58 +0000 (09:31 -0500)
committerChris Nighswonger <cnighswonger@foundations.edu>
Tue, 12 Jan 2010 14:31:58 +0000 (09:31 -0500)
If JS is disabled, dialog still shows.

koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/image-manage.tmpl

index 3d67752..dd023ea 100644 (file)
                 alert("Please select image(s) to " + op + ".");
                 return (-1);
             };
-
+            function showHideLayers(element, time, action) {
+                setTimeout("changeVisibility('" + element + "','" + action + "')", time)
+            }
+            function changeVisibility(element, action) {
+                document.getElementById(element).style.display=action;
+            }
     </script>
     <script type="text/javascript">
         //<![CDATA[
@@ -45,6 +50,7 @@
             $("#upload").empty();
             $("#delete").empty();
             buildButtons();
+            showHideLayers('dialog', 5000, 'none')
          });
 
         function buildButtons() {
                     <div class="yui-u first">
                         <h1>Upload Images</h1>
                         <!-- TMPL_IF name="IMPORT_SUCCESSFUL" -->
-                        <div class="dialog message">
+                        <div id="dialog" class="dialog message">
                             <li><h3>Image successfully uploaded.</h3></li>
                             <li>File: <!-- TMPL_VAR name="SOURCE_FILE" --></li>
                             <li>Image name: <!-- TMPL_VAR name="IMAGE_NAME" --></li>
                     <div class="yui-u">
                     <h1>Delete Images</h1>
                         <!-- TMPL_IF name="DELETE_SUCCESSFULL" -->
-                        <div class="dialog message">
+                        <div id="dialog" class="dialog message">
                             <li><h3>Image(s) successfully deleted.</h3></li>
                         </div>
                         <!-- /TMPL_IF -->