Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resize option not work #596

Open
100cm opened this issue Jan 5, 2018 · 5 comments
Open

resize option not work #596

100cm opened this issue Jan 5, 2018 · 5 comments

Comments

@100cm
Copy link

100cm commented Jan 5, 2018

ERROR TypeError: Cannot read property 'width' of undefined
    at d.h.resizable (scripts.bundle.js:15077)
    at d.h.init (scripts.bundle.js:15077)
    at new d (scripts.bundle.js:15077)

when i init the gridster

  $(".gridster ul").gridster({
      widget_margins: [10, 10],
      widget_base_dimensions: [140, 140],
      helper: 'clone',
      resize: {
        enabled: true,
      }
@bipin244
Copy link

bipin244 commented Jan 11, 2018

I face the same issue can anyone get any solutions?

@100cm
Copy link
Author

100cm commented Jan 12, 2018

@bipin244 i fixed this by adding safe navigator to source code.

  fn.resizable = function () {
    this.resize_api = this.$el.gridDraggable({
      items: '.' + this.options.resize.handle_class,
      offset_left: this.options.widget_margins[0],
      container_width: this.container_width,
      move_element: false,
      resize: true,
      limit: {
      //here
        width: this.options.max_cols !== Infinity || (this.limit || {}).width,
        height: this.options.max_rows !== Infinity || (this.limit || {}).height
      },
      scroll_container: this.options.scroll_container,
      start: $.proxy(this.on_start_resize, this),
      stop: $.proxy(function (event, ui) {
        delay($.proxy(function () {
          this.on_stop_resize(event, ui);
        }, this), 120);
      }, this),
      drag: throttle($.proxy(this.on_resize, this), 60)
    });

    return this;
  };

@kevinch1
Copy link

I see this issue was reported on January the 2, and @icepoint0 provided a solution the 12, I've just downloaded the library and encountered the same problem, tried his fix and it works, if not already, this should be proposed in a pull request (I do not see it in current pull requests).

@sacsooo
Copy link

sacsooo commented Apr 26, 2019

Hi guys! I'm facing the same issue, can you especif where did you added theses line?

Thank you!

@robswc
Copy link

robswc commented May 15, 2019

Hi guys! I'm facing the same issue, can you especif where did you added theses line?

Thank you!

Did you figure it out? Goes in the gridster.js file 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants