Author: achiumenti Date: Mon Sep 1 11:35:46 2008 New Revision: 80
Modified: trunk/main/claw-html.dojo/src/js/ActionLink.js trunk/main/claw-html.dojo/src/js/Form.js trunk/main/claw-html.dojo/src/js/Rounded.js Log: bufixs on js dojo extended components
Modified: trunk/main/claw-html.dojo/src/js/ActionLink.js ============================================================================== --- trunk/main/claw-html.dojo/src/js/ActionLink.js (original) +++ trunk/main/claw-html.dojo/src/js/ActionLink.js Mon Sep 1 11:35:46 2008 @@ -42,16 +42,24 @@ enctype: "", xhr: true, templateString: "<a dojoAttachPoint='containerNode' dojoAttachEvent='onclick:_onClick' href='#'></a>", + parameters: {}, jsonContent: {}, + postCreate: function(){ + this.widgetId = this.id; + this.inherited(arguments); + }, _updateParts: function (reply) { for (var item in reply.components) { var element = dojo.byId(item); if ((element != null) && (reply.components[item] != null)) { var list = dojo.query('[widgetId]', element); dojo.forEach(list.map(dijit.byNode), function(widget){if (widget) widget.destroy(); }); - element.innerHTML = reply.components[item]; - dojo.parser.parse(element, true); } + var oldVisibility = element.style.visibility; + element.style.visibility = 'hidden'; + element.innerHTML = reply.components[item]; + dojo.parser.parse(element, true); + element.style.visibility = oldVisibility; } },
@@ -90,7 +98,7 @@ } this.onBeforeClick(e); var thisLink = this; - var jsonContent = dojo.mixin(this.jsonContent, { json : thisLink.updateId, rewindobject : thisLink.id }); + var jsonContent = dojo.mixin(this.jsonContent, this.parameters, { json : thisLink.updateId, rewindobject : thisLink.id, rewindformobject : thisLink.id}); this.jsonContent = {}; var linkId = this.id; dojo.xhrPost({ @@ -122,7 +130,10 @@ // Callback when user submits the form. This method is // intended to be over-ridden. After the call to dojo.xhrPost // thouches lload or error this event is fired - } + }, + click: function () { + this._onClick(); + } } );
Modified: trunk/main/claw-html.dojo/src/js/Form.js ============================================================================== --- trunk/main/claw-html.dojo/src/js/Form.js (original) +++ trunk/main/claw-html.dojo/src/js/Form.js Mon Sep 1 11:35:46 2008 @@ -1,4 +1,4 @@ -y/** +/** ;;; $Header: dojo/src/js/Form.js $
;;; Copyright (c) 2008, Andrea Chiumenti. All rights reserved. @@ -52,10 +52,13 @@ var element = dojo.byId(item); if ((element != null) && (reply.components[item] != null)) { var list = dojo.query('[widgetId]', element); - dojo.forEach(list.map(dijit.byNode), function(widget){if (widget) widget.destroy(); }); - element.innerHTML = reply.components[item]; - dojo.parser.parse(element, true); + dojo.forEach(list.map(dijit.byNode), function(widget){if (widget) widget.destroy(); }); } + var oldVisibility = element.style.visibility; + element.style.visibility = 'hidden'; + element.innerHTML = reply.components[item]; + dojo.parser.parse(element, true); + element.style.visibility = oldVisibility; } },
@@ -100,6 +103,7 @@ this.jsonContent = {}; var formId = this.id; if (this.enctype != 'multipart/form-data') { + try { dojo.xhrPost({ url: '#', load : function (data) { @@ -109,11 +113,12 @@ thisForm.onXhrFinish(e); } }, - error : function (data) {console.error(data);thisForm.onXhrFinish(e);}, + error : function (data) {console.error("!!!!!!",data);thisForm.onXhrFinish(e);}, timeout : thisForm.xhrTimeout, - handleAs : 'json', + handleAs : 'json', form : formId, content : jsonContent }); + } catch (e) {alert(e);} } else { jsonContent = dojo.mixin(jsonContent, { jsonPrefix: '<textarea>', jsonSuffix: '</textarea>' }); dojo.io.iframe.send({
Modified: trunk/main/claw-html.dojo/src/js/Rounded.js ============================================================================== --- trunk/main/claw-html.dojo/src/js/Rounded.js (original) +++ trunk/main/claw-html.dojo/src/js/Rounded.js Mon Sep 1 11:35:46 2008 @@ -45,13 +45,15 @@ bgImgAlt: "", // background image for ie6
postCreate: function() { - dojo.style(this.contentNode, "height", dojo.style(this.outerNode, "height")-10+'px'); // TODO: Calculate correct height - var alt = (this.bgImgAlt.length && dojo.isIE < 7 && dojo.isIE > 0); - dojo.forEach(["roundedContent","roundedTop","roundedBottom","roundedBottomDiv"], - function(elName){ - dojo.style(this[elName],"backgroundImage", "url(" + (alt ? this.bgImgAlt : this.bgImg) + ")"); - }, - this); + this.widgetId = this.id; + dojo.style(this.contentNode, "height", dojo.style(this.outerNode, "height")-10+'px'); // TODO: Calculate correct height + var alt = (this.bgImgAlt.length && dojo.isIE < 7 && dojo.isIE > 0); + dojo.forEach(["roundedContent","roundedTop","roundedBottom","roundedBottomDiv"], + function(elName){ + dojo.style(this[elName],"backgroundImage", "url(" + (alt ? this.bgImgAlt : this.bgImg) + ")"); + }, + this); + this.inherited(arguments); } });