Author: vmolotkov
Date: 2007-11-21 07:20:42 -0500 (Wed, 21 Nov 2007)
New Revision: 4132
Modified:
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss
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/ShuttleUtils.js
branches/3.1.x/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx
Log:
bug:RF-1377
Modified:
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss
===================================================================
---
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss 2007-11-21
08:58:51 UTC (rev 4131)
+++
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss 2007-11-21
12:20:42 UTC (rev 4132)
@@ -130,9 +130,13 @@
display: none;
}
-.body {
- -moz-user-select: none;
+.disableSelection {
+ -moz-user-select: -moz-none;
}
+
+.disableSelection input {
+ -moz-user-select: text;
+}
]]>
</f:verbatim>
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-21
08:58:51 UTC (rev 4131)
+++
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js 2007-11-21
12:20:42 UTC (rev 4132)
@@ -1,3 +1,13 @@
+if(!window.Richfaces) window.Richfaces = {};
+Richfaces.disableSelectionText = function(target) {
+ target.onselectstart = function(e) {
+ e = window.event||e;
+ if (e.srcElement.tagName != "INPUT")
+ return false;
+ }
+
+}
+
Shuttle = function(containerId, contentTableId, headerTableId, focusKeeperId,
valueKeeperId,
ids, onclickControlId, onorderchanged) {
this.container = document.getElementById(containerId);
@@ -30,6 +40,7 @@
obj.onkeydownHandler(window.event || e);
}
this.init(containerId, contentTableId, headerTableId, ids, onclickControlId);
+ Richfaces.disableSelectionText(this.container);
}
Shuttle.ASC = "acs";
@@ -243,6 +254,8 @@
this.selectionItem(activeElem);
this.activeItem = activeElem;
}
+
+
Richfaces.SelectItems.doActive(this.activeItem);
this.saveState();
this.controlListManager();
Modified:
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 2007-11-21
08:58:51 UTC (rev 4131)
+++
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ShuttleUtils.js 2007-11-21
12:20:42 UTC (rev 4132)
@@ -31,4 +31,5 @@
} 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-21
08:58:51 UTC (rev 4131)
+++
branches/3.1.x/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx 2007-11-21
12:20:42 UTC (rev 4132)
@@ -22,7 +22,7 @@
<f:clientId var="clientId"/>
- <div id="#{clientId}" x:passThruWithExclusions="id">
+ <div id="#{clientId}" class="disableSelection"
x:passThruWithExclusions="id,class">
<input id="#{clientId}focusKeeper" type="button"
value="" style="width: 1px; position: absolute; left: -32767px;"
name="focusKeeper"/>
<input id="#{clientId}valueKeeper" type="hidden"
name="#{clientId}" value="#{component.submittedString}"/>
@@ -66,21 +66,18 @@
<f:clientId var="cId"/>
<script type="text/javascript">
var clientId = '#{cId}';
- /*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() {
- var cotrolsIdPrefix = [['up', 'disup'], ['down',
'disdown'], ['last', 'dislast'],
['first','disfirst']];
- var shuttle = new Shuttle('#{cId}', '#{cId}internal_tab',
'#{cId}internal_header_tab', '#{cId}focusKeeper',
'#{cId}valueKeeper', cotrolsIdPrefix, '#{cId}sortLabel', function()
{#{component.attributes['onorderchanged']}});
+ try {
+ var cotrolsIdPrefix = [['up', 'disup'], ['down',
'disdown'], ['last', 'dislast'],
['first','disfirst']];
+ var shuttle = new Shuttle('#{cId}', '#{cId}internal_tab',
'#{cId}internal_header_tab', '#{cId}focusKeeper',
'#{cId}valueKeeper', cotrolsIdPrefix, '#{cId}sortLabel', function()
{#{component.attributes['onorderchanged']}});
var layoutManager = new LayoutManager('#{clientId}internal_header_tab',
'#{clientId}internal_tab');
layoutManager.widthSynchronization();
+ } catch (e) {
+ alert(e);
+ }
}
//setTimeout(init, 0);
</script>