0.3.14
This commit is contained in:
parent
48b0f3b99c
commit
26386c9e7d
@ -807,6 +807,10 @@ function makeRackObjectsClickable(){
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Public data
|
||||
$(document).data('selectedObjectName', response.templateName);
|
||||
$(document).data('selectedObjectCategoryName', response.categoryName);
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -1882,8 +1886,28 @@ $( document ).ready(function() {
|
||||
$(variables['selectedObj']).click();
|
||||
});
|
||||
|
||||
$('#objDelete').click(function(e){
|
||||
|
||||
// Prevent browser following # link
|
||||
e.preventDefault();
|
||||
|
||||
if($(this).hasClass('disabled')) {
|
||||
|
||||
// Prevent modal from showing
|
||||
e.stopPropagation();
|
||||
|
||||
} else {
|
||||
|
||||
var objectName = $(document).data('selectedObjectName');
|
||||
var objectCategoryName = $(document).data('selectedObjectCategoryName');
|
||||
|
||||
$('#modalConfirmTitle').html('Delete Template');
|
||||
$('#modalConfirmBody').html('Delete <strong>'+objectName+' ('+objectCategoryName+')</strong>?');
|
||||
}
|
||||
});
|
||||
|
||||
// Delete a temlate
|
||||
$('#confirmObjDelete').click(function(){
|
||||
$('#modalConfirmBtn').click(function(){
|
||||
var templateCombined = $(document).data('selectedTemplateCombined');
|
||||
if (templateCombined == 'yes') {
|
||||
var templateID = $(document).data('selectedTemplateCombinedID');
|
||||
|
||||
@ -710,29 +710,6 @@
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
|
||||
<!-- delete template modal -->
|
||||
<div id="modalTemplateDeleteConfirm" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="modalLabelTemplateDeleteConfirm" aria-hidden="true" style="display: none;">
|
||||
<div class="modal-dialog modal-sm">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<div title="Close">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
|
||||
<i class="zmdi zmdi-close"></i>
|
||||
</button>
|
||||
</div>
|
||||
<h4 class="modal-title" id="modalLabelTemplateDeleteConfirm">Delete Template</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
Delete <strong id="deleteTemplateName"></strong>?
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button id="confirmObjDelete" type="button" class="btn btn-secondary btn-danger waves-effect" data-toggle="modal" data-target="#modalTemplateDeleteConfirm">Confirm</button>
|
||||
<button type="button" class="btn btn-secondary waves-effect" data-dismiss="modal">Cancel</button>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
|
||||
<!-- confirm modal -->
|
||||
<div id="modalConfirm" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="modalConfirm" aria-hidden="true" style="display: none;">
|
||||
<div class="modal-dialog modal-sm">
|
||||
|
||||
@ -296,7 +296,7 @@ require_once './includes/content-templates.php';
|
||||
<div class="dropdown-menu">
|
||||
<a id="objFind" class="dropdown-item disabled" href="#" data-toggle="modal" data-target="#modalTemplateWhereUsed"><i class="ion-map"></i> Where Used</a>
|
||||
<a id="objClone" class="dropdown-item disabled" href="#" ><i class="fa fa-copy"></i></span> Clone</a>
|
||||
<a id="objDelete" class="dropdown-item disabled" href="#" data-toggle="modal" data-target="#modalTemplateDeleteConfirm"><i class="fa fa-times"></i></span> Delete</a>
|
||||
<a id="objDelete" class="dropdown-item disabled" href="#" data-toggle="modal" data-target="#modalConfirm"><i class="fa fa-times"></i></span> Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user