diff --git a/doc/CHANGES.md b/doc/CHANGES.md index 5a167a2fd..61bb574c7 100644 --- a/doc/CHANGES.md +++ b/doc/CHANGES.md @@ -138,7 +138,7 @@ also now cache each column layout so you can go back to say 12 column and not lo - `'auto'` value for `cellHeight` option - fix `setStatic` method - add `setAnimation` method to API -- add `setGridWidth` method ([#227](https://github.com/gridstack/gridstack.js/issues/227)) +- add `setColumn` method ([#227](https://github.com/gridstack/gridstack.js/issues/227)) - add `removable`/`removeTimeout` *(experimental)* - add `detachGrid` parameter to `destroy` method ([#216](https://github.com/gridstack/gridstack.js/issues/216)) (thanks @jhpedemonte) - add `useOffset` parameter to `getCellFromPixel` method ([#237](https://github.com/gridstack/gridstack.js/issues/237)) @@ -149,45 +149,45 @@ also now cache each column layout so you can go back to say 12 column and not lo ## v0.2.4 (2016-02-15) - fix closure compiler/linter warnings -- add `static_grid` option. -- add `min_width`/`min_height` methods (Thanks to @cvillemure) +- add `staticGrid` option. +- add `minWidth`/`minHeight` methods (Thanks to @cvillemure) - add `destroy` method (Thanks to @zspitzer) -- add `placeholder_text` option (Thanks to @slauyama) -- add `handle_class` option. -- add `make_widget` method. +- add `placeholderText` option (Thanks to @slauyama) +- add `handleClass` option. +- add `makeWidget` method. - lodash v 4.x support (Thanks to @andrewr88) ## v0.2.3 (2015-06-23) - gridstack-extra.css - add support of lodash.js -- add `is_area_empty` method +- add `isAreaEmpty` method - nested grids -- add `batch_update`/`commit` methods +- add `batchUpdate`/`commit` methods - add `update` method - allow to override `resizable`/`draggable` options - add `disable`/`enable` methods -- add `get_cell_from_pixel` (thanks to @juchi) +- add `getCellFromPixel` (thanks to @juchi) - AMD support - fix nodes sorting - improved touch devices support -- add `always_show_resize_handle` option +- add `alwaysShowResizeHandle` option - minor fixes and improvements ## v0.2.2 (2014-12-23) - fix grid initialization -- add `cell_height`/`cell_width` API methods +- add `cellHeight`/`cellWidth` API methods - fix boolean attributes ([#31](https://github.com/gridstack/gridstack.js/issues/31)) ## v0.2.1 (2014-12-09) - add widgets locking ([#19](https://github.com/gridstack/gridstack.js/issues/19)) -- add `will_it_fit` API method +- add `willItFit` API method - fix auto-positioning ([#20](https://github.com/gridstack/gridstack.js/issues/20)) - add animation (thanks to @ishields) - fix `y` coordinate calculation when dragging ([#18](https://github.com/gridstack/gridstack.js/issues/18)) -- fix `remove_widget` ([#16](https://github.com/gridstack/gridstack.js/issues/16)) +- fix `removeWidget` ([#16](https://github.com/gridstack/gridstack.js/issues/16)) - minor fixes @@ -196,7 +196,7 @@ also now cache each column layout so you can go back to say 12 column and not lo - add `height` option - auto-generate css rules (widgets `height` and `top`) - add `GridStackUI.Utils.sort` utility function -- add `remove_all` API method +- add `removeAll` API method - add `resize` and `move` API methods - add `resizable` and `movable` API methods - add `data-gs-no-move` attribute diff --git a/karma.conf.js b/karma.conf.js index 05d9e2a4a..44488756c 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -16,7 +16,6 @@ module.exports = function(config) { // list of files / patterns to load in the browser files: [ 'node_modules/jquery/dist/jquery.min.js', - 'node_modules/core-js/client/shim.min.js', 'src/gridstack.js', 'dist/jquery-ui.min.js', 'src/gridstack.jQueryUI.js', diff --git a/spec/gridstack-spec.js b/spec/gridstack-spec.js index 72190ae5e..be2e1d20f 100644 --- a/spec/gridstack-spec.js +++ b/spec/gridstack-spec.js @@ -292,7 +292,7 @@ describe('gridstack', function() { expect(grid.opts.column).toBe(12); grid.setColumn(12); expect(grid.opts.column).toBe(12); - grid.setGridWidth(12); // old API + grid.setGridWidth(12); // old 0.5.2 API expect(grid.opts.column).toBe(12); }); it('should SMALL change column number, no relayout', function() { @@ -575,403 +575,6 @@ describe('gridstack', function() { }); }); - describe('grid method obsolete warnings', function() { - beforeEach(function() { - document.body.insertAdjacentHTML('afterbegin', gridstackHTML); - }); - afterEach(function() { - document.body.removeChild(document.getElementById('gs-cont')); - }); - it('should log a warning if set_static is called.', function() { - console.warn = jasmine.createSpy('log'); - var options = { - cellHeight: 80, - verticalMargin: 10 - }; - $('.grid-stack').gridstack(options); - var grid = $('.grid-stack').data('gridstack'); - grid.set_static(true); - expect(console.warn).toHaveBeenCalledWith('gridstack.js: Function `set_static` is deprecated as of v0.2.5 and has been replaced with `setStatic`. It will be **completely** removed in v1.0.'); - }); - it('should log a warning if _set_static_class is called.', function() { - console.warn = jasmine.createSpy('log'); - var options = { - cellHeight: 80, - verticalMargin: 10 - }; - $('.grid-stack').gridstack(options); - var grid = $('.grid-stack').data('gridstack'); - grid._set_static_class(); - expect(console.warn).toHaveBeenCalledWith('gridstack.js: Function `_set_static_class` is deprecated as of v0.2.5 and has been replaced with `_setStaticClass`. It will be **completely** removed in v1.0.'); - }); - it('should log a warning if is_area_empty is called.', function() { - console.warn = jasmine.createSpy('log'); - var options = { - cellHeight: 80, - verticalMargin: 10 - }; - $('.grid-stack').gridstack(options); - var grid = $('.grid-stack').data('gridstack'); - grid.is_area_empty(1, 1, 1, 1); - expect(console.warn).toHaveBeenCalledWith('gridstack.js: Function `is_area_empty` is deprecated as of v0.2.5 and has been replaced with `isAreaEmpty`. It will be **completely** removed in v1.0.'); - }); - it('should log a warning if batch_update is called.', function() { - console.warn = jasmine.createSpy('log'); - var options = { - cellHeight: 80, - verticalMargin: 10 - }; - $('.grid-stack').gridstack(options); - var grid = $('.grid-stack').data('gridstack'); - grid.batch_update(); - expect(console.warn).toHaveBeenCalledWith('gridstack.js: Function `batch_update` is deprecated as of v0.2.5 and has been replaced with `batchUpdate`. It will be **completely** removed in v1.0.'); - }); - it('should log a warning if get_cell_from_pixel is called.', function() { - console.warn = jasmine.createSpy('log'); - var options = { - cellHeight: 80, - verticalMargin: 10 - }; - $('.grid-stack').gridstack(options); - var grid = $('.grid-stack').data('gridstack'); - var pixel = {top: 100, left: 72}; - grid.get_cell_from_pixel(pixel); - expect(console.warn).toHaveBeenCalledWith('gridstack.js: Function `get_cell_from_pixel` is deprecated as of v0.2.5 and has been replaced with `getCellFromPixel`. It will be **completely** removed in v1.0.'); - }); - it('should log a warning if cell_width is called.', function() { - console.warn = jasmine.createSpy('log'); - var options = { - cellHeight: 80, - verticalMargin: 10 - }; - $('.grid-stack').gridstack(options); - var grid = $('.grid-stack').data('gridstack'); - grid.cell_width(); - expect(console.warn).toHaveBeenCalledWith('gridstack.js: Function `cell_width` is deprecated as of v0.2.5 and has been replaced with `cellWidth`. It will be **completely** removed in v1.0.'); - }); - it('should log a warning if cell_height is called.', function() { - console.warn = jasmine.createSpy('log'); - var options = { - cellHeight: 80, - verticalMargin: 10 - }; - $('.grid-stack').gridstack(options); - var grid = $('.grid-stack').data('gridstack'); - grid.cell_height(); - expect(console.warn).toHaveBeenCalledWith('gridstack.js: Function `cell_height` is deprecated as of v0.2.5 and has been replaced with `cellHeight`. It will be **completely** removed in v1.0.'); - }); - it('should log a warning if _update_element is called.', function() { - console.warn = jasmine.createSpy('log'); - var options = { - cellHeight: 80, - verticalMargin: 10 - }; - $('.grid-stack').gridstack(options); - var grid = $('.grid-stack').data('gridstack'); - grid._update_element(); - expect(console.warn).toHaveBeenCalledWith('gridstack.js: Function `_update_element` is deprecated as of v0.2.5 and has been replaced with `_updateElement`. It will be **completely** removed in v1.0.'); - }); - it('should log a warning if min_width is called.', function() { - console.warn = jasmine.createSpy('log'); - var options = { - cellHeight: 80, - verticalMargin: 10 - }; - $('.grid-stack').gridstack(options); - var grid = $('.grid-stack').data('gridstack'); - var items = $('.grid-stack-item'); - for (var i = 0; i < items.length; i++) { - grid.min_width(items[i], 2); - } - expect(console.warn).toHaveBeenCalledWith('gridstack.js: Function `min_width` is deprecated as of v0.2.5 and has been replaced with `minWidth`. It will be **completely** removed in v1.0.'); - }); - it('should log a warning if min_height is called.', function() { - console.warn = jasmine.createSpy('log'); - var options = { - cellHeight: 80, - verticalMargin: 10 - }; - $('.grid-stack').gridstack(options); - var grid = $('.grid-stack').data('gridstack'); - var items = $('.grid-stack-item'); - for (var i = 0; i < items.length; i++) { - grid.min_height(items[i], 2); - } - expect(console.warn).toHaveBeenCalledWith('gridstack.js: Function `min_height` is deprecated as of v0.2.5 and has been replaced with `minHeight`. It will be **completely** removed in v1.0.'); - }); - it('should log a warning if remove_all is called.', function() { - console.warn = jasmine.createSpy('log'); - var options = { - cellHeight: 80, - verticalMargin: 10 - }; - $('.grid-stack').gridstack(options); - var grid = $('.grid-stack').data('gridstack'); - grid.remove_all(); - expect(console.warn).toHaveBeenCalledWith('gridstack.js: Function `remove_all` is deprecated as of v0.2.5 and has been replaced with `removeAll`. It will be **completely** removed in v1.0.'); - }); - it('should log a warning if remove_widget is called.', function() { - console.warn = jasmine.createSpy('log'); - var options = { - cellHeight: 80, - verticalMargin: 10 - }; - $('.grid-stack').gridstack(options); - var grid = $('.grid-stack').data('gridstack'); - var items = $('.grid-stack-item'); - for (var i = 0; i < items.length; i++) { - grid.remove_widget(items[i]); - } - expect(console.warn).toHaveBeenCalledWith('gridstack.js: Function `remove_widget` is deprecated as of v0.2.5 and has been replaced with `removeWidget`. It will be **completely** removed in v1.0.'); - }); - it('should log a warning if will_it_fit is called.', function() { - console.warn = jasmine.createSpy('log'); - var options = { - cellHeight: 80, - verticalMargin: 10 - }; - $('.grid-stack').gridstack(options); - var grid = $('.grid-stack').data('gridstack'); - grid.will_it_fit(0, 0, 1, 1, false); - expect(console.warn).toHaveBeenCalledWith('gridstack.js: Function `will_it_fit` is deprecated as of v0.2.5 and has been replaced with `willItFit`. It will be **completely** removed in v1.0.'); - }); - it('should log a warning if make_widget is called.', function() { - console.warn = jasmine.createSpy('log'); - var options = { - cellHeight: 80, - verticalMargin: 10 - }; - $('.grid-stack').gridstack(options); - var grid = $('.grid-stack').data('gridstack'); - var items = $('.grid-stack-item'); - for (var i = 0; i < items.length; i++) { - grid.make_widget(items[i]); - } - expect(console.warn).toHaveBeenCalledWith('gridstack.js: Function `make_widget` is deprecated as of v0.2.5 and has been replaced with `makeWidget`. It will be **completely** removed in v1.0.'); - }); - it('should log a warning if add_widget is called.', function() { - console.warn = jasmine.createSpy('log'); - var options = { - cellHeight: 80, - verticalMargin: 10 - }; - $('.grid-stack').gridstack(options); - var grid = $('.grid-stack').data('gridstack'); - var items = $('.grid-stack-item'); - for (var i = 0; i < items.length; i++) { - grid.add_widget(items[i]); - } - expect(console.warn).toHaveBeenCalledWith('gridstack.js: Function `add_widget` is deprecated as of v0.2.5 and has been replaced with `addWidget`. It will be **completely** removed in v1.0.'); - }); - it('should log a warning if set_animation is called.', function() { - console.warn = jasmine.createSpy('log'); - var options = { - cellHeight: 80, - verticalMargin: 10 - }; - $('.grid-stack').gridstack(options); - var grid = $('.grid-stack').data('gridstack'); - grid.set_animation(true); - expect(console.warn).toHaveBeenCalledWith('gridstack.js: Function `set_animation` is deprecated as of v0.2.5 and has been replaced with `setAnimation`. It will be **completely** removed in v1.0.'); - }); - it('should log a warning if _prepare_element is called.', function() { - console.warn = jasmine.createSpy('log'); - var options = { - cellHeight: 80, - verticalMargin: 10 - }; - $('.grid-stack').gridstack(options); - var grid = $('.grid-stack').data('gridstack'); - var items = $('.grid-stack-item'); - for (var i = 0; i < items.length; i++) { - grid._prepare_element(items[i]); - } - expect(console.warn).toHaveBeenCalledWith('gridstack.js: Function `_prepare_element` is deprecated as of v0.2.5 and has been replaced with `_prepareElement`. It will be **completely** removed in v1.0.'); - }); - it('should log a warning if _is_one_column_mode is called.', function() { - console.warn = jasmine.createSpy('log'); - var options = { - cellHeight: 80, - verticalMargin: 10 - }; - $('.grid-stack').gridstack(options); - var grid = $('.grid-stack').data('gridstack'); - grid._is_one_column_mode(); - expect(console.warn).toHaveBeenCalledWith('gridstack.js: Function `_is_one_column_mode` is deprecated as of v0.2.5 and has been replaced with `_isOneColumnMode`. It will be **completely** removed in v1.0.'); - }); - it('should log a warning if _update_container_height is called.', function() { - console.warn = jasmine.createSpy('log'); - var options = { - cellHeight: 80, - verticalMargin: 10 - }; - $('.grid-stack').gridstack(options); - var grid = $('.grid-stack').data('gridstack'); - grid._update_container_height(); - expect(console.warn).toHaveBeenCalledWith('gridstack.js: Function `_update_container_height` is deprecated as of v0.2.5 and has been replaced with `_updateContainerHeight`. It will be **completely** removed in v1.0.'); - }); - it('should log a warning if _update_styles is called.', function() { - console.warn = jasmine.createSpy('log'); - var options = { - cellHeight: 80, - verticalMargin: 10 - }; - $('.grid-stack').gridstack(options); - var grid = $('.grid-stack').data('gridstack'); - grid._update_styles(); - expect(console.warn).toHaveBeenCalledWith('gridstack.js: Function `_update_styles` is deprecated as of v0.2.5 and has been replaced with `_updateStyles`. It will be **completely** removed in v1.0.'); - }); - it('should log a warning if _init_styles is called.', function() { - console.warn = jasmine.createSpy('log'); - var options = { - cellHeight: 80, - verticalMargin: 10 - }; - $('.grid-stack').gridstack(options); - var grid = $('.grid-stack').data('gridstack'); - grid._init_styles(); - expect(console.warn).toHaveBeenCalledWith('gridstack.js: Function `_init_styles` is deprecated as of v0.2.5 and has been replaced with `_initStyles`. It will be **completely** removed in v1.0.'); - }); - it('should log a warning if _trigger_change_event is called.', function() { - console.warn = jasmine.createSpy('log'); - var options = { - cellHeight: 80, - verticalMargin: 10 - }; - $('.grid-stack').gridstack(options); - var grid = $('.grid-stack').data('gridstack'); - grid._trigger_change_event(); - expect(console.warn).toHaveBeenCalledWith('gridstack.js: Function `_trigger_change_event` is deprecated as of v0.2.5 and has been replaced with `_triggerChangeEvent`. It will be **completely** removed in v1.0.'); - }); - }); - - describe('grid opts obsolete warnings', function() { - beforeEach(function() { - document.body.insertAdjacentHTML('afterbegin', gridstackHTML); - }); - afterEach(function() { - document.body.removeChild(document.getElementById('gs-cont')); - }); - it('should log a warning if handle_class is set.', function() { - console.warn = jasmine.createSpy('log'); - var options = { - cellHeight: 80, - verticalMargin: 10, - handle_class: 'grid-stack-header' - - }; - $('.grid-stack').gridstack(options); - var grid = $('.grid-stack').data('gridstack'); - expect(console.warn).toHaveBeenCalledWith('gridstack.js: Option `handle_class` is deprecated as of v0.2.5 and has been replaced with `handleClass`. It will be **completely** removed in v1.0.'); - }); - it('should log a warning if item_class is set.', function() { - console.warn = jasmine.createSpy('log'); - var options = { - cellHeight: 80, - verticalMargin: 10, - item_class: 'grid-stack-item' - - }; - $('.grid-stack').gridstack(options); - var grid = $('.grid-stack').data('gridstack'); - expect(console.warn).toHaveBeenCalledWith('gridstack.js: Option `item_class` is deprecated as of v0.2.5 and has been replaced with `itemClass`. It will be **completely** removed in v1.0.'); - }); - it('should log a warning if placeholder_class is set.', function() { - console.warn = jasmine.createSpy('log'); - var options = { - cellHeight: 80, - verticalMargin: 10, - placeholder_class: 'grid-stack-placeholder' - - }; - $('.grid-stack').gridstack(options); - var grid = $('.grid-stack').data('gridstack'); - expect(console.warn).toHaveBeenCalledWith('gridstack.js: Option `placeholder_class` is deprecated as of v0.2.5 and has been replaced with `placeholderClass`. It will be **completely** removed in v1.0.'); - }); - it('should log a warning if placeholder_text is set.', function() { - console.warn = jasmine.createSpy('log'); - var options = { - cellHeight: 80, - verticalMargin: 10, - placeholder_text: 'placeholder' - - }; - $('.grid-stack').gridstack(options); - var grid = $('.grid-stack').data('gridstack'); - expect(console.warn).toHaveBeenCalledWith('gridstack.js: Option `placeholder_text` is deprecated as of v0.2.5 and has been replaced with `placeholderText`. It will be **completely** removed in v1.0.'); - }); - it('should log a warning if cell_height is set.', function() { - console.warn = jasmine.createSpy('log'); - var options = { - cell_height: 80, - verticalMargin: 10 - - }; - $('.grid-stack').gridstack(options); - var grid = $('.grid-stack').data('gridstack'); - expect(console.warn).toHaveBeenCalledWith('gridstack.js: Option `cell_height` is deprecated as of v0.2.5 and has been replaced with `cellHeight`. It will be **completely** removed in v1.0.'); - }); - it('should log a warning if vertical_margin is set.', function() { - console.warn = jasmine.createSpy('log'); - var options = { - cellHeight: 80, - vertical_margin: 10 - - }; - $('.grid-stack').gridstack(options); - var grid = $('.grid-stack').data('gridstack'); - expect(console.warn).toHaveBeenCalledWith('gridstack.js: Option `vertical_margin` is deprecated as of v0.2.5 and has been replaced with `verticalMargin`. It will be **completely** removed in v1.0.'); - }); - it('should log a warning if min_width is set.', function() { - console.warn = jasmine.createSpy('log'); - var options = { - cellHeight: 80, - verticalMargin: 10, - min_width: 2 - - }; - $('.grid-stack').gridstack(options); - var grid = $('.grid-stack').data('gridstack'); - expect(console.warn).toHaveBeenCalledWith('gridstack.js: Option `min_width` is deprecated as of v0.2.5 and has been replaced with `minWidth`. It will be **completely** removed in v1.0.'); - }); - it('should log a warning if static_grid is set.', function() { - console.warn = jasmine.createSpy('log'); - var options = { - cellHeight: 80, - verticalMargin: 10, - static_grid: false - - }; - $('.grid-stack').gridstack(options); - var grid = $('.grid-stack').data('gridstack'); - expect(console.warn).toHaveBeenCalledWith('gridstack.js: Option `static_grid` is deprecated as of v0.2.5 and has been replaced with `staticGrid`. It will be **completely** removed in v1.0.'); - }); - it('should log a warning if is_nested is set.', function() { - console.warn = jasmine.createSpy('log'); - var options = { - cellHeight: 80, - verticalMargin: 10, - is_nested: false - - }; - $('.grid-stack').gridstack(options); - var grid = $('.grid-stack').data('gridstack'); - expect(console.warn).toHaveBeenCalledWith('gridstack.js: Option `is_nested` is deprecated as of v0.2.5 and has been replaced with `isNested`. It will be **completely** removed in v1.0.'); - }); - it('should log a warning if always_show_resize_handle is set.', function() { - console.warn = jasmine.createSpy('log'); - var options = { - cellHeight: 80, - verticalMargin: 10, - always_show_resize_handle: false - - }; - $('.grid-stack').gridstack(options); - var grid = $('.grid-stack').data('gridstack'); - expect(console.warn).toHaveBeenCalledWith('gridstack.js: Option `always_show_resize_handle` is deprecated as of v0.2.5 and has been replaced with `alwaysShowResizeHandle`. It will be **completely** removed in v1.0.'); - }); - }); - describe('grid method _packNodes with float', function() { beforeEach(function() { document.body.insertAdjacentHTML('afterbegin', gridstackHTML); diff --git a/src/gridstack.js b/src/gridstack.js index 959094199..f771032c3 100644 --- a/src/gridstack.js +++ b/src/gridstack.js @@ -22,7 +22,7 @@ // checks for obsolete method names var obsolete = function(f, oldName, newName) { var wrapper = function() { - console.warn('gridstack.js: Function `' + oldName + '` is deprecated as of v0.2.5 and has been replaced ' + + console.warn('gridstack.js: Function `' + oldName + '` is deprecated as of v0.5.2 and has been replaced ' + 'with `' + newName + '`. It will be **completely** removed in v1.0.'); return f.apply(this, arguments); }; @@ -35,7 +35,7 @@ var obsoleteOpts = function(opts, oldName, newName) { if (opts[oldName] !== undefined) { opts[newName] = opts[oldName]; - console.warn('gridstack.js: Option `' + oldName + '` is deprecated as of v0.2.5 and has been replaced with `' + + console.warn('gridstack.js: Option `' + oldName + '` is deprecated as of v0.5.2 and has been replaced with `' + newName + '`. It will be **completely** removed in v1.0.'); } }; @@ -248,13 +248,6 @@ } }; - /*eslint-disable camelcase */ - Utils.is_intercepted = obsolete(Utils.isIntercepted, 'is_intercepted', 'isIntercepted'); - Utils.create_stylesheet = obsolete(Utils.createStylesheet, 'create_stylesheet', 'createStylesheet'); - Utils.remove_stylesheet = obsolete(Utils.removeStylesheet, 'remove_stylesheet', 'removeStylesheet'); - Utils.insert_css_rule = obsolete(Utils.insertCSSRule, 'insert_css_rule', 'insertCSSRule'); - /*eslint-enable camelcase */ - /** * @class GridStackDragDropPlugin * Base class for drag'n'drop plugin. @@ -672,24 +665,12 @@ this.container = $(el); - /*eslint-disable camelcase */ - obsoleteOpts(opts, 'handle_class', 'handleClass'); - obsoleteOpts(opts, 'item_class', 'itemClass'); - obsoleteOpts(opts, 'placeholder_class', 'placeholderClass'); - obsoleteOpts(opts, 'placeholder_text', 'placeholderText'); - obsoleteOpts(opts, 'cell_height', 'cellHeight'); - obsoleteOpts(opts, 'vertical_margin', 'verticalMargin'); - obsoleteOpts(opts, 'min_width', 'minWidth'); - obsoleteOpts(opts, 'static_grid', 'staticGrid'); - obsoleteOpts(opts, 'is_nested', 'isNested'); - obsoleteOpts(opts, 'always_show_resize_handle', 'alwaysShowResizeHandle'); obsoleteOpts(opts, 'width', 'column'); obsoleteOpts(opts, 'height', 'maxRow'); // container attributes obsoleteAttr(this.container, 'data-gs-width', 'data-gs-column'); obsoleteAttr(this.container, 'data-gs-height', 'data-gs-max-row'); - /*eslint-enable camelcase */ opts.itemClass = opts.itemClass || 'grid-stack-item'; var isNested = this.container.closest('.' + opts.itemClass).length > 0; @@ -1869,13 +1850,6 @@ this.commit(); }; - // legacy call from <= 0.5.2 - use new method instead. - GridStack.prototype.setGridWidth = function(column, doNotPropagate) { - console.warn('gridstack.js: setGridWidth() is deprecated as of v0.5.3 and has been replaced ' + - 'with setColumn(). It will be **completely** removed in v1.0.'); - this.setColumn(column, doNotPropagate); - } - GridStack.prototype.float = function(val) { // getter - returns the opts stored mode if (val === undefined) { @@ -1890,84 +1864,9 @@ } }; - /*eslint-disable camelcase */ - GridStackEngine.prototype.batch_update = obsolete(GridStackEngine.prototype.batchUpdate); - GridStackEngine.prototype._fix_collisions = obsolete(GridStackEngine.prototype._fixCollisions, - '_fix_collisions', '_fixCollisions'); - GridStackEngine.prototype.is_area_empty = obsolete(GridStackEngine.prototype.isAreaEmpty, - 'is_area_empty', 'isAreaEmpty'); - GridStackEngine.prototype._sort_nodes = obsolete(GridStackEngine.prototype._sortNodes, - '_sort_nodes', '_sortNodes'); - GridStackEngine.prototype._pack_nodes = obsolete(GridStackEngine.prototype._packNodes, - '_pack_nodes', '_packNodes'); - GridStackEngine.prototype._prepare_node = obsolete(GridStackEngine.prototype._prepareNode, - '_prepare_node', '_prepareNode'); - GridStackEngine.prototype.clean_nodes = obsolete(GridStackEngine.prototype.cleanNodes, - 'clean_nodes', 'cleanNodes'); - GridStackEngine.prototype.get_dirty_nodes = obsolete(GridStackEngine.prototype.getDirtyNodes, - 'get_dirty_nodes', 'getDirtyNodes'); - GridStackEngine.prototype.add_node = obsolete(GridStackEngine.prototype.addNode, - 'add_node', 'addNode, '); - GridStackEngine.prototype.remove_node = obsolete(GridStackEngine.prototype.removeNode, - 'remove_node', 'removeNode'); - GridStackEngine.prototype.can_move_node = obsolete(GridStackEngine.prototype.canMoveNode, - 'can_move_node', 'canMoveNode'); - GridStackEngine.prototype.move_node = obsolete(GridStackEngine.prototype.moveNode, - 'move_node', 'moveNode'); - GridStackEngine.prototype.get_grid_height = obsolete(GridStackEngine.prototype.getGridHeight, - 'get_grid_height', 'getGridHeight'); - GridStackEngine.prototype.begin_update = obsolete(GridStackEngine.prototype.beginUpdate, - 'begin_update', 'beginUpdate'); - GridStackEngine.prototype.end_update = obsolete(GridStackEngine.prototype.endUpdate, - 'end_update', 'endUpdate'); - GridStackEngine.prototype.can_be_placed_with_respect_to_height = - obsolete(GridStackEngine.prototype.canBePlacedWithRespectToHeight, - 'can_be_placed_with_respect_to_height', 'canBePlacedWithRespectToHeight'); - GridStack.prototype._trigger_change_event = obsolete(GridStack.prototype._triggerChangeEvent, - '_trigger_change_event', '_triggerChangeEvent'); - GridStack.prototype._init_styles = obsolete(GridStack.prototype._initStyles, - '_init_styles', '_initStyles'); - GridStack.prototype._update_styles = obsolete(GridStack.prototype._updateStyles, - '_update_styles', '_updateStyles'); - GridStack.prototype._update_container_height = obsolete(GridStack.prototype._updateContainerHeight, - '_update_container_height', '_updateContainerHeight'); - GridStack.prototype._is_one_column_mode = obsolete(GridStack.prototype._isOneColumnMode, - '_is_one_column_mode','_isOneColumnMode'); - GridStack.prototype._prepare_element = obsolete(GridStack.prototype._prepareElement, - '_prepare_element', '_prepareElement'); - GridStack.prototype.set_animation = obsolete(GridStack.prototype.setAnimation, - 'set_animation', 'setAnimation'); - GridStack.prototype.add_widget = obsolete(GridStack.prototype.addWidget, - 'add_widget', 'addWidget'); - GridStack.prototype.make_widget = obsolete(GridStack.prototype.makeWidget, - 'make_widget', 'makeWidget'); - GridStack.prototype.will_it_fit = obsolete(GridStack.prototype.willItFit, - 'will_it_fit', 'willItFit'); - GridStack.prototype.remove_widget = obsolete(GridStack.prototype.removeWidget, - 'remove_widget', 'removeWidget'); - GridStack.prototype.remove_all = obsolete(GridStack.prototype.removeAll, - 'remove_all', 'removeAll'); - GridStack.prototype.min_height = obsolete(GridStack.prototype.minHeight, - 'min_height', 'minHeight'); - GridStack.prototype.min_width = obsolete(GridStack.prototype.minWidth, - 'min_width', 'minWidth'); - GridStack.prototype._update_element = obsolete(GridStack.prototype._updateElement, - '_update_element', '_updateElement'); - GridStack.prototype.cell_height = obsolete(GridStack.prototype.cellHeight, - 'cell_height', 'cellHeight'); - GridStack.prototype.cell_width = obsolete(GridStack.prototype.cellWidth, - 'cell_width', 'cellWidth'); - GridStack.prototype.get_cell_from_pixel = obsolete(GridStack.prototype.getCellFromPixel, - 'get_cell_from_pixel', 'getCellFromPixel'); - GridStack.prototype.batch_update = obsolete(GridStack.prototype.batchUpdate, - 'batch_update', 'batchUpdate'); - GridStack.prototype.is_area_empty = obsolete(GridStack.prototype.isAreaEmpty, - 'is_area_empty', 'isAreaEmpty'); - GridStack.prototype.set_static = obsolete(GridStack.prototype.setStatic, - 'set_static', 'setStatic'); - GridStack.prototype._set_static_class = obsolete(GridStack.prototype._setStaticClass, - '_set_static_class', '_setStaticClass'); - /*eslint-enable camelcase */ + // legacy method renames + GridStack.prototype.setGridWidth = obsolete(GridStack.prototype.setColumn, + 'setGridWidth', 'setColumn'); // 0.5.3 scope.GridStackUI = GridStack;