github github
  • Home
  • Pricing and Signup
  • Training
  • Gist
  • Blog
  • Login

jquery / jquery-ui

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
    • 1,215
    • 303
  • Source
  • Commits
  • Network
  • Pull Requests (7)
  • Graphs
  • Tree: a78d5ee

click here to add a description

click here to add a homepage

  • Switch Branches (9)
    • bind
    • devpreview
    • formcontrols
    • master
    • menu
    • panel
    • spinner
    • tooltip
    • widget-super
  • Switch Tags (23)
    • 1.9m2
    • 1.9m1
    • 1.8rc3
    • 1.8rc2
    • 1.8rc1
    • 1.8b1
    • 1.8a2
    • 1.8a1
    • 1.8.6
    • 1.8.5
    • 1.8.4
    • 1.8.3
    • 1.8.2
    • 1.8.1
    • 1.8
    • 1.7
    • 1.6rc6
    • 1.6rc5
    • 1.6rc3
    • 1.6rc2
    • 1.6
    • 1.5.2
    • 1.5.1
  • Comments
  • Contributors
Sending Request…
Downloads

The official jQuery user interface library. — Read more

  Cancel

http://jqueryui.com/

  Cancel
  • HTTP
  • Git Read-Only

This URL has Read+Write access

Resizable: Patched the alsoResize plugin to fix 2 critical bugs. Fixes #5694 - Invalid reference in UI Resizable hack for Opera. Fixes #5662/5695/3842 - When resizing from top or left edge, Dialog adds top/left CSS values to content element. Enhances Dialog - Allows dialog-content to have position:relative to 'contain' floated and positioned elements. Bug Demo for #5662 - http://layout.jquery-dev.net/samples/ui_dialog_bug.html 
ALLPRO (author)
Wed Jun 09 14:06:53 -0700 2010
scottgonzalez (committer)
Wed Jun 09 18:33:00 -0700 2010
commit  a78d5ee4c8c21b2da263
tree    122f4105ebc4ed06dd3f
parent  a8311f955a0cf3fef005

Showing 1 changed file with 33 additions and 20 deletions.

M ui/jquery.ui.resizable.js 53 ••••
Txt ui/jquery.ui.resizable.js
  • View file @ a78d5ee
... ...
@@ -528,28 +528,29 @@ $.extend($.ui.resizable, {
528 528
 
529 529
 $.ui.plugin.add("resizable", "alsoResize", {
530 530
 
531  
-  start: function(event, ui) {
532  
-
  531
+  start: function (event, ui) {
533 532
     var self = $(this).data("resizable"), o = self.options;
534 533
 
535  
-    var _store = function(exp) {
  534
+    var _store = function (exp) {
536 535
       $(exp).each(function() {
537  
-        $(this).data("resizable-alsoresize", {
538  
-          width: parseInt($(this).width(), 10), height: parseInt($(this).height(), 10),
539  
-          left: parseInt($(this).css('left'), 10), top: parseInt($(this).css('top'), 10)
  536
+        var el = $(this);
  537
+        el.data("resizable-alsoresize", {
  538
+          width: parseInt(el.width(), 10), height: parseInt(el.height(), 10),
  539
+          left: parseInt(el.css('left'), 10), top: parseInt(el.css('top'), 10),
  540
+          position: el.css('position') // to reset Opera on stop()
540 541
         });
541 542
       });
542 543
     };
543 544
 
544 545
     if (typeof(o.alsoResize) == 'object' && !o.alsoResize.parentNode) {
545  
-      if (o.alsoResize.length) { o.alsoResize = o.alsoResize[0];  _store(o.alsoResize); }
546  
-      else { $.each(o.alsoResize, function(exp, c) { _store(exp); }); }
  546
+      if (o.alsoResize.length) { o.alsoResize = o.alsoResize[0]; _store(o.alsoResize); }
  547
+      else { $.each(o.alsoResize, function (exp) { _store(exp); }); }
547 548
     }else{
548 549
       _store(o.alsoResize);
549 550
     }
550 551
   },
551 552
 
552  
-  resize: function(event, ui){
  553
+  resize: function (event, ui) {
553 554
     var self = $(this).data("resizable"), o = self.options, os = self.originalSize, op = self.originalPosition;
554 555
 
555 556
     var delta = {
... ...
@@ -557,18 +558,19 @@ $.ui.plugin.add("resizable", "alsoResize", {
557 558
       top: (self.position.top - op.top) || 0, left: (self.position.left - op.left) || 0
558 559
     },
559 560
 
560  
-    _alsoResize = function(exp, c) {
  561
+    _alsoResize = function (exp, c) {
561 562
       $(exp).each(function() {
562  
-        var el = $(this), start = $(this).data("resizable-alsoresize"), style = {}, css = c && c.length ? c : ['width', 'height', 'top', 'left'];
  563
+        var el = $(this), start = $(this).data("resizable-alsoresize"), style = {}, 
  564
+          css = c && c.length ? c : el.parents(ui.originalElement[0]).length ? ['width', 'height'] : ['width', 'height', 'top', 'left'];
563 565
 
564  
-        $.each(css || ['width', 'height', 'top', 'left'], function(i, prop) {
  566
+        $.each(css, function (i, prop) {
565 567
           var sum = (start[prop]||0) + (delta[prop]||0);
566 568
           if (sum && sum >= 0)
567 569
             style[prop] = sum || null;
568 570
         });
569 571
 
570  
-        //Opera fixing relative position
571  
-        if (/relative/.test(el.css('position')) && $.browser.opera) {
  572
+        // Opera fixing relative position
  573
+        if ($.browser.opera && /relative/.test(el.css('position'))) {
572 574
           self._revertToRelativePosition = true;
573 575
           el.css({ position: 'absolute', top: 'auto', left: 'auto' });
574 576
         }
... ...
@@ -578,22 +580,33 @@ $.ui.plugin.add("resizable", "alsoResize", {
578 580
     };
579 581
 
580 582
     if (typeof(o.alsoResize) == 'object' && !o.alsoResize.nodeType) {
581  
-      $.each(o.alsoResize, function(exp, c) { _alsoResize(exp, c); });
  583
+      $.each(o.alsoResize, function (exp, c) { _alsoResize(exp, c); });
582 584
     }else{
583 585
       _alsoResize(o.alsoResize);
584 586
     }
585 587
   },
586 588
 
587  
-  stop: function(event, ui){
  589
+  stop: function (event, ui) {
588 590
     var self = $(this).data("resizable");
589 591
 
590  
-    //Opera fixing relative position
591  
-    if (self._revertToRelativePosition && $.browser.opera) {
  592
+    _reset = function (exp) {
  593
+      $(exp).each(function() {
  594
+        var el = $(this);
  595
+        // reset position for Opera - no need to verify it was changed
  596
+        el.css({ position: el.data("resizable-alsoresize").position });
  597
+      });
  598
+    }
  599
+
  600
+    if (self._revertToRelativePosition) {
592 601
       self._revertToRelativePosition = false;
593  
-      el.css({ position: 'relative' });
  602
+      if (typeof(o.alsoResize) == 'object' && !o.alsoResize.nodeType) {
  603
+        $.each(o.alsoResize, function (exp) { _reset(exp); });
  604
+      }else{
  605
+        _reset(o.alsoResize);
  606
+      }
594 607
     }
595 608
 
596  
-    $(this).removeData("resizable-alsoresize-start");
  609
+    $(this).removeData("resizable-alsoresize");
597 610
   }
598 611
 });
599 612
 

0 notes on commit a78d5ee

Please log in to comment.
Dedicated Server Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
  • Blog
  • Support
  • Training
  • Job Board
  • Shop
  • Contact
  • API
  • Status
  • © 2010 GitHub Inc. All rights reserved.
  • Terms of Service
  • Privacy
  • Security
  • English
  • Deutsch
  • Français
  • 日本語
  • Português (BR)
  • Русский
  • 中文
  • See all available languages

Your current locale selection: English. Choose another?

  • English
  • Afrikaans
  • Català
  • Čeština
  • Deutsch
  • Español
  • Français
  • Hrvatski
  • Indonesia
  • Italiano
  • 日本語
  • Nederlands
  • Norsk
  • Polski
  • Português (BR)
  • Русский
  • Српски
  • Svenska
  • 中文

Keyboard Shortcuts

Site wide shortcuts

s
Focus site search
?
Bring up this help dialog

Commit list

j
Move selected down
k
Move selected up
t
Open tree
p
Open parent
c or o or enter
Open commit

Pull request list

j
Move selected down
k
Move selected up
o or enter
Open issue

Issues

j
Move selected down
k
Move selected up
x
Toggle select target
o or enter
Open issue
I
Mark selected as read
U
Mark selected as unread
e
Close selected
y
Remove selected from view
c
Create issue
l
Create label
i
Back to inbox
u
Back to issues
/
Focus issues search

Network Graph

← or h
Scroll left
→ or l
Scroll right
↑ or k
Scroll up
↓ or j
Scroll down
t
Toggle visibility of head labels
shift ← or shift h
Scroll all the way left
shift → or shift l
Scroll all the way right
shift ↑ or shift k
Scroll all the way up
shift ↓ or shift j
Scroll all the way down