Dodanie biblioteki jquery.resizable.js pozwalającej na zmianę wielkości paska boczneg...
authorzuber <marek@stepniowski.com>
Thu, 20 Aug 2009 13:57:53 +0000 (15:57 +0200)
committerzuber <marek@stepniowski.com>
Thu, 20 Aug 2009 13:57:53 +0000 (15:57 +0200)
project/static/css/master.css
project/static/js/jquery.resizable.js [new file with mode: 0644]
project/templates/explorer/file_xml.html

index 03bcd21..c31c4fe 100644 (file)
@@ -75,7 +75,7 @@ label {
 }
 
 #images-wrap {
 }
 
 #images-wrap {
-    width: 0px;
+/*    width: 0px;*/
     height: 480px;
     border-right: 1px solid #999;
     overflow-y: scroll;
     height: 480px;
     border-right: 1px solid #999;
     overflow-y: scroll;
@@ -99,7 +99,7 @@ label {
 
 #toggle-sidebar:hover {
     background-color: #999;
 
 #toggle-sidebar:hover {
     background-color: #999;
-    cursor: pointer;
+    cursor: ew-resize;
 }
 
 #status-bar {
 }
 
 #status-bar {
diff --git a/project/static/js/jquery.resizable.js b/project/static/js/jquery.resizable.js
new file mode 100644 (file)
index 0000000..415aa2d
--- /dev/null
@@ -0,0 +1,31 @@
+(function($){
+    $.resizable = {
+        element: {},
+        drag: function(event) {
+            $.resizable.element.element.css({
+                width: Math.max(event.pageX - $.resizable.element.mouseX + $.resizable.element.width, 0)
+            })
+            $.resizable.element.element.trigger('resizable:resize');
+            return false;
+        },
+        stop: function() {
+            $.resizable.element.element.trigger('resizable:stop');
+            $().unbind('mousemove', $.resizable.drag).unbind('mouseup', $.resizable.stop);
+            return false;
+        }
+    };
+    
+    $.fn.resizable = function(handle) {
+        var element = $(this);
+        $(handle, element).mousedown(function(event) {
+            var position = element.position();
+            $.resizable.element = {
+                element: element,
+                width: parseInt(element.css('width')) || element[0].scrollWidth || 0,
+                mouseX: event.pageX,
+            };
+            $().mousemove($.resizable.drag).mouseup($.resizable.stop);
+        });
+    };
+})(jQuery);
+
index 314c08e..b78e3de 100644 (file)
@@ -7,11 +7,12 @@
     <script src="/static/js/codemirror/codemirror.js" type="text/javascript" charset="utf-8"></script>
     <script src="/static/js/jquery.autoscroll.js" type="text/javascript" charset="utf-8"></script>
     <script src="/static/js/jquery.wtooltip.js" type="text/javascript" charset="utf-8"></script>
     <script src="/static/js/codemirror/codemirror.js" type="text/javascript" charset="utf-8"></script>
     <script src="/static/js/jquery.autoscroll.js" type="text/javascript" charset="utf-8"></script>
     <script src="/static/js/jquery.wtooltip.js" type="text/javascript" charset="utf-8"></script>
+    <script src="/static/js/jquery.resizable.js" type="text/javascript" charset="utf-8"></script>
     <script type="text/javascript" charset="utf-8">        
         $(function() {
             $('#id_folders').change(function() {
                 $('#images').load('{% url folder_image_ajax %}' + $('#id_folders').val() + '/', function() {
     <script type="text/javascript" charset="utf-8">        
         $(function() {
             $('#id_folders').change(function() {
                 $('#images').load('{% url folder_image_ajax %}' + $('#id_folders').val() + '/', function() {
-                    $('#images').data('lastScroll', -1000);
+                    $('#images-wrap').data('lazyload:lastCheckedScrollTop', -10000);
                 });
             });
             
                 });
             });
             
@@ -19,6 +20,7 @@
                 $('iframe').width($(window).width() - $('#sidebar').outerWidth());
                 $('iframe').height($(window).height() - 100);
                 $('#images-wrap, #toggle-sidebar').height($(window).height() - 100);
                 $('iframe').width($(window).width() - $('#sidebar').outerWidth());
                 $('iframe').height($(window).height() - 100);
                 $('#images-wrap, #toggle-sidebar').height($(window).height() - 100);
+                $('#images-wrap').width($('#sidebar').width() - 8);
             }
             
             $('#toggle-sidebar').toggle(function() {
             }
             
             $('#toggle-sidebar').toggle(function() {
@@ -87,6 +89,8 @@
                         return event.ctrlKey && keys[event.keyCode];
                     });
 
                         return event.ctrlKey && keys[event.keyCode];
                     });
 
+                    // $('#sidebar').bind('resizable:resize', resizePanels).resizable('#toggle-sidebar');
+                    
                     resizePanels();
                 }
             });
                     resizePanels();
                 }
             });