From 937b05f11754af520afba8575edcdb30042c20c8 Mon Sep 17 00:00:00 2001 From: Alexander Mihalicyn Date: Wed, 31 Jan 2018 11:16:20 +0300 Subject: [PATCH] Fix unhandled error thrown during a draw operation in breakpoints and editing components --- src/js/components/breakpoints/FooTable.Breakpoints.js | 7 +++++-- src/js/components/editing/FooTable.Editing.js | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/js/components/breakpoints/FooTable.Breakpoints.js b/src/js/components/breakpoints/FooTable.Breakpoints.js index f19d3622..11a69c21 100644 --- a/src/js/components/breakpoints/FooTable.Breakpoints.js +++ b/src/js/components/breakpoints/FooTable.Breakpoints.js @@ -118,7 +118,9 @@ * @protected */ draw: function(){ - this.ft.$el.removeClass(this._classNames).addClass('breakpoint-' + this.current.name); + if (this.current){ + this.ft.$el.removeClass(this._classNames).addClass('breakpoint-' + this.current.name); + } }, /* PUBLIC */ @@ -144,6 +146,7 @@ } hidden.push(current.name); self.hidden = hidden.join(' '); + self.current = current; return current; }, /** @@ -243,4 +246,4 @@ F.components.register('breakpoints', F.Breakpoints, 1000); -})(jQuery, FooTable); \ No newline at end of file +})(jQuery, FooTable); diff --git a/src/js/components/editing/FooTable.Editing.js b/src/js/components/editing/FooTable.Editing.js index 7af3b164..bdce573e 100644 --- a/src/js/components/editing/FooTable.Editing.js +++ b/src/js/components/editing/FooTable.Editing.js @@ -355,7 +355,9 @@ * Performs the drawing of the component. */ draw: function(){ - this.$cell.attr('colspan', this.ft.columns.visibleColspan); + if (this.enabled){ + this.$cell.attr('colspan', this.ft.columns.visibleColspan); + } }, /** * Handles the edit button click event.