diff --git a/Disco.Web/Areas/Config/Views/DeviceModel/_DeviceComponentsTable.cshtml b/Disco.Web/Areas/Config/Views/DeviceModel/_DeviceComponentsTable.cshtml index f7c15a4f..d5306cf4 100644 --- a/Disco.Web/Areas/Config/Views/DeviceModel/_DeviceComponentsTable.cshtml +++ b/Disco.Web/Areas/Config/Views/DeviceModel/_DeviceComponentsTable.cshtml @@ -52,7 +52,13 @@ return false; }); - var removeComponentConfirmed = function (id, row) { + $deviceComponents.on('change', 'input', updateComponent); + $deviceComponents.on('focus', 'input', function () { $(this).select(); }); + + $deviceComponents.on('click', 'span.remove', removeComponent); + $deviceComponents.on('click', 'span.edit', editComponentJobTypes); + + function removeComponentConfirmed(id, row) { var data = { id: id }; $.ajax({ url: '@Url.Action(MVC.API.DeviceModel.ComponentRemove())', @@ -70,7 +76,7 @@ } }); } - var removeComponent = function () { + function removeComponent() { var componentRow = $(this).closest('tr'); var id = componentRow.attr('data-devicecomponentid'); if (id) { @@ -84,7 +90,7 @@ componentRow.remove(); } } - var updateComponent = function () { + function updateComponent() { var componentRow = $(this).closest('tr'); componentRow.find('input').attr('disabled', true).addClass('updating'); @@ -143,7 +149,7 @@ }); } } - var editComponentJobTypes = function () { + function editComponentJobTypes() { var edit$this = $(this); var componentRow = edit$this.closest('tr'); @@ -246,12 +252,6 @@ }); $('#CheckboxBulkSelect_dialogUpdateJobTypes').checkboxBulkSelect({ parentSelector: 'div' }); - - $deviceComponents.on('change', 'input', updateComponent); - $deviceComponents.on('focus', 'input', function () { $(this).select(); }); - - $deviceComponents.on('click', 'span.remove', removeComponent); - $deviceComponents.on('click', 'span.edit', editComponentJobTypes); });
diff --git a/Disco.Web/Areas/Config/Views/DeviceModel/_DeviceComponentsTable.generated.cs b/Disco.Web/Areas/Config/Views/DeviceModel/_DeviceComponentsTable.generated.cs index 0e66ac6c..52326875 100644 --- a/Disco.Web/Areas/Config/Views/DeviceModel/_DeviceComponentsTable.generated.cs +++ b/Disco.Web/Areas/Config/Views/DeviceModel/_DeviceComponentsTable.generated.cs @@ -2,7 +2,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.18033 +// Runtime Version:4.0.30319.18051 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -182,13 +182,19 @@ WriteLiteral(@"> return false; }); - var removeComponentConfirmed = function (id, row) { + $deviceComponents.on('change', 'input', updateComponent); + $deviceComponents.on('focus', 'input', function () { $(this).select(); }); + + $deviceComponents.on('click', 'span.remove', removeComponent); + $deviceComponents.on('click', 'span.edit', editComponentJobTypes); + + function removeComponentConfirmed(id, row) { var data = { id: id }; $.ajax({ url: '"); - #line 58 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml" + #line 64 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml" Write(Url.Action(MVC.API.DeviceModel.ComponentRemove())); @@ -200,26 +206,25 @@ WriteLiteral("\',\r\n dataType: \'json\',\r\n data "lert(\'Unable to remove component: \' + d);\r\n }\r\n " + " },\r\n error: function (jqXHR, textStatus, errorThrown) {\r\n " + " alert(\'Unable to remove component: \' + textStatus);\r\n " + -" }\r\n });\r\n }\r\n var removeComponent = function () {\r\n " + -" var componentRow = $(this).closest(\'tr\');\r\n var id = compo" + -"nentRow.attr(\'data-devicecomponentid\');\r\n if (id) {\r\n " + -"var dialog = $(\"#dialogConfirmRemove\");\r\n var buttons = dialog.di" + -"alog(\"option\", \"buttons\");\r\n buttons[\'Remove\'] = function () { re" + -"moveComponentConfirmed(id, componentRow); $(this).dialog(\"close\"); };\r\n " + -" var buttons = dialog.dialog(\"option\", \"buttons\", buttons);\r\n " + -" dialog.dialog(\'open\');\r\n } else {\r\n // New - Remove" + -"\r\n componentRow.remove();\r\n }\r\n }\r\n var " + -"updateComponent = function () {\r\n var componentRow = $(this).closest(" + -"\'tr\');\r\n componentRow.find(\'input\').attr(\'disabled\', true).addClass(\'" + -"updating\');\r\n\r\n var id = componentRow.attr(\'data-devicecomponentid\');" + -"\r\n if (id) {\r\n // Update\r\n var data = {" + -"\r\n id: id,\r\n Description: componentRow.fin" + -"d(\'input.description\').val(),\r\n Cost: componentRow.find(\'inpu" + -"t.cost\').val()\r\n };\r\n $.ajax({\r\n " + -" url: \'"); +" }\r\n });\r\n }\r\n function removeComponent() {\r\n " + +" var componentRow = $(this).closest(\'tr\');\r\n var id = componentRow" + +".attr(\'data-devicecomponentid\');\r\n if (id) {\r\n var dia" + +"log = $(\"#dialogConfirmRemove\");\r\n var buttons = dialog.dialog(\"o" + +"ption\", \"buttons\");\r\n buttons[\'Remove\'] = function () { removeCom" + +"ponentConfirmed(id, componentRow); $(this).dialog(\"close\"); };\r\n " + +"var buttons = dialog.dialog(\"option\", \"buttons\", buttons);\r\n dial" + +"og.dialog(\'open\');\r\n } else {\r\n // New - Remove\r\n " + +" componentRow.remove();\r\n }\r\n }\r\n function up" + +"dateComponent() {\r\n var componentRow = $(this).closest(\'tr\');\r\n " + +" componentRow.find(\'input\').attr(\'disabled\', true).addClass(\'updating\');\r\n\r" + +"\n var id = componentRow.attr(\'data-devicecomponentid\');\r\n " + +"if (id) {\r\n // Update\r\n var data = {\r\n " + +" id: id,\r\n Description: componentRow.find(\'input.descr" + +"iption\').val(),\r\n Cost: componentRow.find(\'input.cost\').val()" + +"\r\n };\r\n $.ajax({\r\n url: \'"); - #line 100 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml" + #line 106 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml" Write(Url.Action(MVC.API.DeviceModel.ComponentUpdate())); @@ -254,7 +259,7 @@ WriteLiteral(@"', url: '"); - #line 126 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml" + #line 132 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml" Write(Url.Action(MVC.API.DeviceModel.ComponentAdd(null, null, null))); @@ -280,7 +285,7 @@ WriteLiteral(@"', }); } } - var editComponentJobTypes = function () { + function editComponentJobTypes() { var edit$this = $(this); var componentRow = edit$this.closest('tr'); @@ -294,7 +299,7 @@ WriteLiteral(@"', url: '"); - #line 157 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml" + #line 163 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml" Write(Url.Action(MVC.API.DeviceModel.Component())); @@ -322,7 +327,7 @@ WriteLiteral("\',\r\n dataType: \'json\',\r\n "ajax({\r\n url: \'"); - #line 181 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml" + #line 187 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml" Write(Url.Action(MVC.API.DeviceModel.ComponentUpdateJobSubTypes())); @@ -364,11 +369,7 @@ WriteLiteral("\',\r\n dataType: \'json\',\r\n "\r\n },\r\n Cancel: function () {\r\n " + " $(this).dialog(\"close\");\r\n }\r\n }\r\n });\r\n\r\n " + " $(\'#CheckboxBulkSelect_dialogUpdateJobTypes\').checkboxBulkSelect({ parentSel" + -"ector: \'div\' });\r\n\r\n $deviceComponents.on(\'change\', \'input\', updateCompon" + -"ent);\r\n $deviceComponents.on(\'focus\', \'input\', function () { $(this).sele" + -"ct(); });\r\n\r\n $deviceComponents.on(\'click\', \'span.remove\', removeComponen" + -"t);\r\n $deviceComponents.on(\'click\', \'span.edit\', editComponentJobTypes);\r" + -"\n });\r\n\r\n\r\n