From c7296afaeeff4e2148b37bed8ba7a5da4db874e1 Mon Sep 17 00:00:00 2001 From: wstagf Date: Mon, 7 Nov 2016 10:12:50 -0200 Subject: [PATCH 1/4] Update script.js --- demo/main/script.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/demo/main/script.js b/demo/main/script.js index e97ff89f..6df17c17 100644 --- a/demo/main/script.js +++ b/demo/main/script.js @@ -94,66 +94,77 @@ angular.module('app') x: 2, y: 1 }, + drawable: true, position: [0, 0] }, { size: { x: 2, y: 2 }, + drawable: false, position: [0, 2] }, { size: { x: 1, y: 1 }, + drawable: true, position: [1, 4] }, { size: { x: 1, y: 2 }, + drawable: false, position: [1, 5] }, { size: { x: 1, y: 1 }, + drawable: false, position: [2, 0] }, { size: { x: 2, y: 1 }, + drawable: true, position: [2, 1] }, { size: { x: 1, y: 1 }, + drawable: true, position: [2, 3] }, { size: { x: 1, y: 1 }, + drawable: true, position: [0, 4] }, { size: { x: 1, y: 1 }, + drawable: true, position: [0, 5] }, { size: { x: 2, y: 1 }, + drawable: true, position: [1, 0] }, { size: { x: 1, y: 1 }, + drawable: true, position: [2, 4] }]; From c006ad8050c5871b66667ebb76fe4950d672d293 Mon Sep 17 00:00:00 2001 From: wstagf Date: Mon, 7 Nov 2016 10:18:37 -0200 Subject: [PATCH 2/4] Update script.js --- demo/main/script.js | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/demo/main/script.js b/demo/main/script.js index 6df17c17..e97ff89f 100644 --- a/demo/main/script.js +++ b/demo/main/script.js @@ -94,77 +94,66 @@ angular.module('app') x: 2, y: 1 }, - drawable: true, position: [0, 0] }, { size: { x: 2, y: 2 }, - drawable: false, position: [0, 2] }, { size: { x: 1, y: 1 }, - drawable: true, position: [1, 4] }, { size: { x: 1, y: 2 }, - drawable: false, position: [1, 5] }, { size: { x: 1, y: 1 }, - drawable: false, position: [2, 0] }, { size: { x: 2, y: 1 }, - drawable: true, position: [2, 1] }, { size: { x: 1, y: 1 }, - drawable: true, position: [2, 3] }, { size: { x: 1, y: 1 }, - drawable: true, position: [0, 4] }, { size: { x: 1, y: 1 }, - drawable: true, position: [0, 5] }, { size: { x: 2, y: 1 }, - drawable: true, position: [1, 0] }, { size: { x: 1, y: 1 }, - drawable: true, position: [2, 4] }]; From 06002e6b3a90cd479b1113d89903ac3cd4500bf5 Mon Sep 17 00:00:00 2001 From: wstagf Date: Mon, 7 Nov 2016 10:21:15 -0200 Subject: [PATCH 3/4] Drawble attribute only item with this code is possible drawable:true/false only this items --- demo/main/script.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/demo/main/script.js b/demo/main/script.js index e97ff89f..d5ed0067 100644 --- a/demo/main/script.js +++ b/demo/main/script.js @@ -94,66 +94,77 @@ angular.module('app') x: 2, y: 1 }, + drawable: true, position: [0, 0] }, { size: { x: 2, y: 2 }, + drawable: true, position: [0, 2] }, { size: { x: 1, y: 1 }, + drawable: false, position: [1, 4] }, { size: { x: 1, y: 2 }, + drawable: false, position: [1, 5] }, { size: { x: 1, y: 1 }, + drawable: false, position: [2, 0] }, { size: { x: 2, y: 1 }, + drawable: true, position: [2, 1] }, { size: { x: 1, y: 1 }, + drawable: true, position: [2, 3] }, { size: { x: 1, y: 1 }, + drawable: true, position: [0, 4] }, { size: { x: 1, y: 1 }, + drawable: true, position: [0, 5] }, { size: { x: 2, y: 1 }, + drawable: true, position: [1, 0] }, { size: { x: 1, y: 1 }, + drawable: true, position: [2, 4] }]; From 1d55693e0b8c6d3ab9d29a743102415ffd117e5d Mon Sep 17 00:00:00 2001 From: wstagf Date: Mon, 7 Nov 2016 10:24:18 -0200 Subject: [PATCH 4/4] Drawable:true/false iten code --- src/angular-gridster.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/angular-gridster.js b/src/angular-gridster.js index 5fa8499f..154e398a 100755 --- a/src/angular-gridster.js +++ b/src/angular-gridster.js @@ -1392,15 +1392,17 @@ var inputTags = ['select', 'option', 'input', 'textarea', 'button']; function dragStart(event) { - $el.addClass('gridster-item-moving'); - gridster.movingItem = item; - - gridster.updateHeight(item.sizeY); - scope.$apply(function() { - if (gridster.draggable && gridster.draggable.start) { - gridster.draggable.start(event, $el, itemOptions, item); - } - }); + if (($el[0].attributes.getNamedItem('data-drawable').nodeValue === "true") ) { + $el.addClass('gridster-item-moving'); + gridster.movingItem = item; + + gridster.updateHeight(item.sizeY); + scope.$apply(function () { + if (gridster.draggable && gridster.draggable.start) { + gridster.draggable.start(event, $el, itemOptions, item); + } + }); + } } function drag(event) {