[claw-cvs] r88 - trunk/main/claw-html.dojo/src/js

achiumenti at common-lisp.net achiumenti at common-lisp.net
Mon Sep 8 09:36:05 UTC 2008


Author: achiumenti
Date: Mon Sep  8 05:36:04 2008
New Revision: 88

Modified:
   trunk/main/claw-html.dojo/src/js/Dialog.js
Log:
CLAW dojo dialo enhancement

Modified: trunk/main/claw-html.dojo/src/js/Dialog.js
==============================================================================
--- trunk/main/claw-html.dojo/src/js/Dialog.js	(original)
+++ trunk/main/claw-html.dojo/src/js/Dialog.js	Mon Sep  8 05:36:04 2008
@@ -1,5 +1,5 @@
 /**
-;;; $Header: dojo/src/js/HardLink.js $
+;;; $Header: dojo/src/js/Dialog.js $
 
 ;;; Copyright (c) 2008, Andrea Chiumenti.  All rights reserved.
 
@@ -28,13 +28,31 @@
 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
-//if(!dojo._hasResource["claw.Dialog"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+if(!dojo._hasResource["claw.Dialog"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
     dojo.provide("claw.Dialog");
 
     dojo.require("dijit.Dialog");
 
     dojo.declare(
         "claw.Dialog",
-        dijit.Dialog
+        [dijit.Dialog],
+        {
+            closable: true,
+            templateString:  "<div class=\"dijitDialog\" tabindex=\"-1\" waiRole=\"dialog\" waiState=\"labelledby-${id}_title\">\n\t<div dojoAttachPoint=\"titleBar\" class=\"dijitDialogTitleBar\">\n\t<span dojoAttachPoint=\"titleNode\" class=\"dijitDialogTitle\" id=\"${id}_title\">${title}</span>\n\t<span dojoAttachPoint=\"closeButtonNode\" class=\"dijitDialogCloseIcon\" dojoAttachEvent=\"onclick: onCancel\">\n\t\t<span dojoAttachPoint=\"closeText\" class=\"closeText\">x</span>\n\t</span>\n\t</div>\n\t\t<div dojoAttachPoint=\"containerNode\" class=\"dijitDialogPaneContent\"></div>\n</div>\n",
+            templateStringUnclosable:  "<div class=\"dijitDialog\" tabindex=\"-1\" waiRole=\"dialog\" waiState=\"labelledby-${id}_title\">\n\t<div dojoAttachPoint=\"titleBar\" class=\"dijitDialogTitleBar\">\n\t<span dojoAttachPoint=\"titleNode\" class=\"dijitDialogTitle\" id=\"${id}_title\">${title}</span>\n\t</div>\n\t\t<div dojoAttachPoint=\"containerNode\" class=\"dijitDialogPaneContent\"></div>\n</div>\n",
+            _onKey: function(/*Event*/ evt){
+                if((evt.charOrCode == dojo.keys.ESCAPE) && !(this.closable)) {
+                    return;
+                } else {
+                    this.inherited(arguments);
+                }
+            },
+            postMixInProperties: function(){
+                if (!this.closable) {
+                    this.templateString = this.templateStringUnclosable;
+                }
+                this.inherited(arguments);
+            }
+        }
     );
-//}
\ No newline at end of file
+}
\ No newline at end of file



More information about the Claw-cvs mailing list