From 608724285215caf1d80105eb09d4fcb1d983d107 Mon Sep 17 00:00:00 2001 From: Quentin THEURET Date: Tue, 15 May 2018 20:42:14 +0200 Subject: [PATCH] [FIX] #921 Fixed issue when discard a modal with draggable element --- web_dialog_size/static/src/js/web_dialog_size.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/web_dialog_size/static/src/js/web_dialog_size.js b/web_dialog_size/static/src/js/web_dialog_size.js index f1684791..13e9484a 100644 --- a/web_dialog_size/static/src/js/web_dialog_size.js +++ b/web_dialog_size/static/src/js/web_dialog_size.js @@ -36,9 +36,11 @@ Dialog.include({ }, close: function() { - var draggable = this.$modal.draggable( "instance" ); - if (draggable) { - this.$modal.draggable("destroy"); + if (this.$modal) { + var draggable = this.$modal.draggable("instance"); + if (draggable) { + this.$modal.draggable("destroy"); + } } return this._super.apply(this, arguments); },