Author: vmolotkov
Date: 2007-11-20 11:25:31 -0500 (Tue, 20 Nov 2007)
New Revision: 4110
Added:
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ShuttleUtils.js
Modified:
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js
branches/3.1.x/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx
Log:
bug: RF-1379
Modified:
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js
===================================================================
---
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js 2007-11-20
15:53:03 UTC (rev 4109)
+++
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js 2007-11-20
16:25:31 UTC (rev 4110)
@@ -1,23 +1,3 @@
-if (LayoutManager.isIE()) {
-Array.prototype.indexOf = function(obj) {
- for(var i=0; i < this.length; i++) {
- if(this[i]==obj) {
- return i;
- }
- }
- return -1;
-}
-}
-
-Array.prototype.remove = function(object) {
- var index = this.indexOf(object, 0, this.length);
- if (index == 0) {
- this.shift();
- } else {
- this.splice(index, 1);
- }
-}
-
Shuttle = function(containerId, contentTableId, headerTableId, focusKeeperId,
valueKeeperId,
ids, onclickControlId, onorderchanged) {
this.container = document.getElementById(containerId);
Added:
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ShuttleUtils.js
===================================================================
---
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ShuttleUtils.js
(rev 0)
+++
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ShuttleUtils.js 2007-11-20
16:25:31 UTC (rev 4110)
@@ -0,0 +1,34 @@
+Object.extend(Event, {
+ _domReady : function() {
+ if (arguments.callee.done) return;
+ arguments.callee.done = true;
+ if (Event._timer) clearInterval(Event._timer);
+ Event._readyCallbacks.each(function(f) { f() });
+ Event._readyCallbacks = null;
+ },
+ onReady : function(f) {
+ if (!this._readyCallbacks) {
+ var domReady = this._domReady;
+ if (domReady.done) return f();
+ if (document.addEventListener)
+ document.addEventListener("DOMContentLoaded", domReady, false);
+ if (/WebKit/i.test(navigator.userAgent)) {
+ this._timer = setInterval(function() {
+ if (/loaded|complete/.test(document.readyState)) domReady();
+ }, 10);
+ }
+ Event.observe(window, 'load', domReady);
+ Event._readyCallbacks = [];
+ }
+ Event._readyCallbacks.push(f);
+ }
+});
+
+Array.prototype.remove = function(object) {
+ var index = this.indexOf(object, 0, this.length);
+ if (index == 0) {
+ this.shift();
+ } else {
+ this.splice(index, 1);
+ }
+}
\ No newline at end of file
Modified:
branches/3.1.x/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx
===================================================================
---
branches/3.1.x/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx 2007-11-20
15:53:03 UTC (rev 4109)
+++
branches/3.1.x/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx 2007-11-20
16:25:31 UTC (rev 4110)
@@ -13,6 +13,7 @@
<h:scripts>
new org.ajax4jsf.javascript.PrototypeScript(),
+ scripts/ShuttleUtils.js,
scripts/SelectItem.js,
scripts/LayoutManager.js
scripts/Control.js,
@@ -62,15 +63,17 @@
</table>
<a id="#{clientId}sortLabel" href="#">Header</a>
- </div>
<f:clientId var="cId"/>
<script type="text/javascript">
var clientId = '#{cId}';
- if (window.attachEvent) {
+ /*if (window.attachEvent) {
window.attachEvent("onload", init);
} else {
window.addEventListener("load", init, false);
- }
+ }*/
+
+ Event.onReady(init);
+
document.body.onselectstart = function() {return false;};
document.body.className = "body";
function init() {
@@ -81,4 +84,5 @@
}
//setTimeout(init, 0);
</script>
+ </div>
</f:root>
\ No newline at end of file
Show replies by date