Add confirmation dialog when deleting things (#1)

pull/54/merge
Candid Dauth 2016-10-30 18:04:40 +03:00
rodzic 32d513a060
commit 3d6c169bc8
6 zmienionych plików z 9 dodań i 5 usunięć

Wyświetl plik

@ -48,6 +48,10 @@ var FacilMap = {
};
});
fm.app.run(function($rootScope) {
$rootScope.confirm = function(msg) { return confirm(msg); };
});
function wrapApply($scope, f) {
return function() {
var context = this;

Wyświetl plik

@ -11,5 +11,5 @@
<div class="buttons" ng-if="!readonly">
<button type="button" class="btn btn-default" ng-click="edit()">Edit</button>
<button type="button" class="btn btn-default" ng-click="move()">Move</button>
<button type="button" class="btn btn-default" ng-click="delete()">Remove</button>
<button type="button" class="btn btn-default" ng-click="confirm('Do you really want to remove the line “' + line.name + '”?') && delete()">Remove</button>
</div>

Wyświetl plik

@ -11,5 +11,5 @@
<div class="buttons" ng-if="!readonly">
<button type="button" class="btn btn-default" ng-click="edit()">Edit</button>
<button type="button" class="btn btn-default" ng-click="move()">Move</button>
<button type="button" class="btn btn-default" ng-click="delete()">Remove</button>
<button type="button" class="btn btn-default" ng-click="confirm('Do you really want to remove the marker “' + marker.name + '”?') && delete()">Remove</button>
</div>

Wyświetl plik

@ -47,7 +47,7 @@
<td ng-if="field.controlSize"><input type="text" ng-model="option.size" fm-spinner fm-spinner-min="15" class="form-control"></td>
<td ng-if="field.controlSymbol"><input type="text" ng-model="option.symbol" fm-icon-picker class="form-control"></td>
<td ng-if="field.controlWidth"><input type="text" ng-model="option.width" fm-spinner class="form-control"></td>
<td class="td-buttons"><button type="button" ng-click="deleteOption(option)" class="btn btn-default"><span class="glyphicon glyphicon-minus"></span></button></td>
<td class="td-buttons"><button type="button" ng-click="confirm('Do you really want to delete the option “' + option.value + '”?') && deleteOption(option)" class="btn btn-default"><span class="glyphicon glyphicon-minus"></span></button></td>
<td class="td-buttons move"><a href="javascript:" class="btn btn-default sort-handle"><span class="glyphicon glyphicon-resize-vertical"></span></a></td>
</tr>
</tbody>

Wyświetl plik

@ -116,7 +116,7 @@
</select>
</td>
<td fm-type-field="field" fm-type-field-model="field.default" fm-type-field-ignore-default></td>
<td class="td-buttons"><button type="button" ng-click="deleteField(field)" class="btn btn-default">Delete</button></td>
<td class="td-buttons"><button type="button" ng-click="confirm('Do you really want to delete the field “' + field.name + '”?') && deleteField(field)" class="btn btn-default">Delete</button></td>
<td class="move td-buttons"><a href="javascript:" class="btn btn-default sort-handle"><span class="glyphicon glyphicon-resize-vertical"></span></a></td>
</tr>
</tbody>

Wyświetl plik

@ -18,7 +18,7 @@
<td>{{type.type}}</td>
<td class="td-buttons">
<button type="button" ng-click="edit(type)" class="btn btn-default">Edit</button>
<button type="button" ng-click="delete(type)" class="btn btn-default">Delete</button>
<button type="button" ng-click="confirm('Do you really want to delete the type “' + type.name + '”?') && delete(type)" class="btn btn-default">Delete</button>
</td>
</tr>
</tbody>