Author: sergeyhalipov
Date: 2007-07-10 12:14:12 -0400 (Tue, 10 Jul 2007)
New Revision: 1585
Modified:
branches/3.0.2/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
Log:
RF-69: Some improvements in script.
Modified:
branches/3.0.2/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
===================================================================
---
branches/3.0.2/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2007-07-10
15:59:27 UTC (rev 1584)
+++
branches/3.0.2/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2007-07-10
16:14:12 UTC (rev 1585)
@@ -380,6 +380,7 @@
}
var options = {};
+ this.userOptions = {};
if (!this.cdiv.mpSet) {
Object.extend(options, this.options);
@@ -387,10 +388,9 @@
if (opts) {
Object.extend(options, opts);
+ Object.extend(this.userOptions, opts);
}
- Object.extend(this.options, options);
-
if (options.width) {
if (this.minWidth > options.width) {
options.width = this.minWidth;
@@ -554,7 +554,7 @@
Element.hide(this.id);
- if (this.floatedToBody && this.parent && this.parent.firstChild) {
+ if (this.floatedToBody && this.parent) {
document.body.removeChild(this.id);
this.parent.appendChild(this.id);
this.floatedToBody = false;
@@ -675,8 +675,8 @@
Element.setStyle(this.iframe, cssHashWH);
}
- Object.extend(this.options, cssHash);
- Object.extend(this.options, cssHashWH);
+ Object.extend(this.userOptions, cssHash);
+ Object.extend(this.userOptions, cssHashWH);
var w = this.context.width();
var h = this.context.height();
@@ -704,7 +704,7 @@
},
setStateInput: function(e) {
- var target = e.target ? e.target : e.srcElement;
+ var target = Event.element(e);
if (e && target) {
var input = document.createElement("input");
input.type = "hidden";
@@ -713,14 +713,14 @@
input.value = this.shown ? "true" : "false";
target.appendChild(input);
- var keys = $H(this.options).keys();
+ var keys = $H(this.userOptions).keys();
if (keys) {
for (var i = 0; i < keys.length; i++) {
input = document.createElement("input");
input.type = "hidden";
input.id = this.markerId.id + "StateOption_" + keys[i];
input.name = this.markerId.id + "StateOption_" + keys[i];
- input.value = this.options[keys[i]];
+ input.value = this.userOptions[keys[i]];
target.appendChild(input);
}