Opened 14 years ago

Closed 12 years ago

#4500 closed enhancement (duplicate)

Resizable: in event resize when using grid ui.size does not honor the grid

Reported by: mmoossen Owned by:
Priority: major Milestone: 1.9.0
Component: ui.resizable Version: 1.7.1
Keywords: resizable event resize grid Cc:
Blocked by: Blocking:

Description

Given the following code, the event will be fired continuously as if ignoring the grid option.

      $div.resizable({
        grid: [10, 10],
        resize: function(/**Event*/event, /**UIHelper*/ui) {
                  $width.val(ui.size.width + 'px');
                  $height.val(ui.size.height + 'px');
                }
      });

Change History (5)

comment:1 Changed 14 years ago by mmoossen

I did fix it with following code:

        resize: function(/**Event*/event, /**UIHelper*/ui) {
                  // HACK: we can not use ui.size because of bug #4500
                  var /**int*/width = $div.css('width');
                  var /**int*/height = $div.css('height');
                  if ((width == $width.val()) && (height == $height.val())) {
                    // prevent unneeded calls
                    return;
                  }
                  $width.val(width);
                  $height.val(height);
                }

comment:2 Changed 14 years ago by mmoossen

And of course, /int*/ should be /String*/ ;)

comment:3 Changed 14 years ago by Jörn Zaefferer

Milestone: TBD1.7.2
Type: bugenhancement

comment:4 Changed 14 years ago by Jörn Zaefferer

Milestone: 1.7.21.8

comment:5 Changed 12 years ago by Scott González

Resolution: duplicate
Status: newclosed

Duplicate of #5817.

Note: See TracTickets for help on using tickets.