From d11ebcb652fb76391928bbbc0c338d4a5737e3a9 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 1 Dec 2017 13:25:39 +0100 Subject: [roomplanner] Sort already placed machines to the bottom --- modules-available/roomplanner/js/grid.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'modules-available/roomplanner/js') diff --git a/modules-available/roomplanner/js/grid.js b/modules-available/roomplanner/js/grid.js index 334057bf..466e42aa 100644 --- a/modules-available/roomplanner/js/grid.js +++ b/modules-available/roomplanner/js/grid.js @@ -74,10 +74,13 @@ if (!roomplanner) var roomplanner = { initDelete: function(el) { $(el).append('
'); $(el).find('.deleteHandle').click(function() { - if ($(this).parent().attr('itemtype') == "pc") { + if ($(this).parent().attr('itemtype') === "pc") { var self = this; BootstrapDialog.confirm(__('are you sure'),function(result) { if (result) { + if (onPcDelete) { + onPcDelete($(self).parent().attr('muuid')); + } $(self).parent().remove(); } }); @@ -169,8 +172,8 @@ if (!roomplanner) var roomplanner = { var mw = $(this).resizable("option","maxWidth"); var mh = $(this).resizable("option","maxHeight"); - var hLimit = ($(this).attr('scalable') == 'v'); - var vLimit = ($(this).attr('scalable') == 'h'); + var hLimit = ($(this).attr('scalable') === 'v'); + var vLimit = ($(this).attr('scalable') === 'h'); if(collides.length) { $(collides).each(function(idx,item) { -- cgit v1.2.3-55-g7522