ultimix

- Main Page
- Data Structures
- Files
- Examples

- File List
- Globals

_jquery.tree.rtl.js
Go to the documentation of this file.
1 (function ($) {
2 $.extend($.tree.plugins, {
3 "rtl" : {
4 defaults : {
5 attribute : "data"
6 },
7 callbacks : {
8 onload : function() {
9 this.container.css("direction","rtl").children("ul:eq(0)").removeClass("ltr").addClass("rtl");
10 },
11 oninit : function() {
12 if(!$.tree.plugins.rtl.css) {
13 var css = '.tree .rtl li.last { float:right; } #jstree-dragged .rtl { margin:0; padding:0; } #jstree-marker.marker_rtl { width:40px; background-position:right center; } /* RTL modification */ .tree .rtl, .tree .rtl ul { margin:0 10px 0 0; } .tree .rtl li { padding:0 10px 0 0; } .tree .rtl li a, .tree .rtl li span { padding:1px 4px 1px 4px; } .tree > .rtl > li { display:table; } .tree .rtl ins { margin:0 0px 0 4px; }';
14 if(/msie/.test(u) && !/opera/.test(u)) {
15 if(parseInt(v) == 6) css += '#jstree-dragged .rtl { width:20px; } .tree .rtl li.last { margin-top: expression( (this.previousSibling && /open/.test(this.previousSibling.className) ) ? "-2px" : "0"); } .marker_rtl { width:40px; background-position:right center; } ';
16 if(parseInt(v) == 7) css += '.tree .rtl li.last { float:none; } #jstree-dragged .rtl { width:200px; }';
17 }
18 if(/mozilla/.test(u) && !/(compatible|webkit)/.test(u) && v.indexOf("1.8") == 0) css += '.tree .rtl li a { display:inline; float:right; }';
19 $.tree.plugins.rtl.css = this.add_sheet({ str : css });
20 }
21 }
22 }
23 }
24 });
25 })(jQuery);
26
27 // in mousemove:
28 // tmp.drag_help.css({ "left" : (event.pageX - (tmp.origin_tree.settings.ui.rtl ? tmp.w : -5 ) ), "top" : (event.pageY + 15) });
29 // if(cnt.children("ul:eq(0)").hasClass("rtl")) goTo.x += et.width() - 28;
30 // if(cnt.children("ul:eq(0)").hasClass("rtl")) { tree_component.drag_drop.marker.attr("class","marker_rtl"); }
31 // if(cnt.children("ul:eq(0)").hasClass("rtl")) goTo.x += 36;
32 // tree_component.drag_drop.marker.css({ "left" : et_off.left + ( cnt.children("ul:eq(0)").hasClass("rtl") ? (cnt.width() - 10) : 10 ) , "top" : et_off.top + 15 }).show();