question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Resize callback gets the map object for the widget

See original GitHub issue

When using a custom item map, the “widget” passed to the resize function is the map, rather than the original source object. For example, using the demo script.js, and adding:

resize: function(event, $element, widget) {
    console.log("in resizeable.resize", widget);
}

to the resizable config. When doing a resize, the output is: in resizeable.resize Object {sizeX: "item.size.x", sizeY: "item.size.y", row: "item.position[0]", col: "item.position[1]"}

I would think it should be the actual object, as defined in $scope.customItems[n]. For example:

{
    size: {x: 2, y: 1 },
    position: [0, 0]
}

I think this applies to the other callbacks, as well.

Issue Analytics

  • State:open
  • Created 9 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
Mouldecommented, Feb 23, 2016

Like the above, when using a custom map object, then the map object is returned as “widget” in resize event. And when using a custom widget object without the necessary sizeX PositionX etc, and then using the attributes to map to the actual properties like so.

<div gridster>
    <ul>
        <li gridster-item row="item.position[0]" col="item.position[1]" size-x="item.size.x" size-y="item.size.y" ng-repeat="item in customItems"></li>
    </ul>
</div>

Then the widget object returned as “widget” is the above element.

And when binding the correct widget object, that has the right sizeX positionY properties, then the bound object is returned in the resize function.

I would expect the behavior of the resize function to be the same, no matter if using a widget object, a custom map or mapping using the attributes. It should always be returning the “item” object.

0reactions
k1ng440commented, Jun 21, 2015

+1

Read more comments on GitHub >

github_iconTop Results From Across the Web

Resizable Widget | jQuery UI API Documentation
The resizable widget uses the jQuery UI CSS framework to style its look and feel. If resizable specific styling is needed, the following...
Read more >
How to resize the symbol when the map extent gets changed ...
I need to resize the PictureMarkerSymbol when the map extent gets changed. I am able to catch the event with watch() but somehow...
Read more >
Provide flexible widget layouts - Android Developers
This page describes refinements for widget sizing and greater flexibility introduced in Android 12 (API level 31). It also details how to determine...
Read more >
QWidget Class | Qt Widgets 6.4.1
When changing the geometry, the widget, if visible, receives a move event (moveEvent()) and/or a resize event (resizeEvent()) immediately.
Read more >
JavaScript Resizable Configuration - DevExtreme - DevExpress
Information about the event. Object structure: component: Resizable. The widget's instance. element: HTMLElement | jQuery.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found