diff --git a/styles/bootstrap/application.js b/styles/bootstrap/application.js index 3f19d52dd..07424633f 100644 --- a/styles/bootstrap/application.js +++ b/styles/bootstrap/application.js @@ -271,6 +271,40 @@ $(document).ready( function() { ); }); + $('body').on('click', 'a.lock-document-btn', function(ev){ + ev.preventDefault(); + attr_rel = $(ev.currentTarget).attr('rel'); + attr_msg = $(ev.currentTarget).attr('msg'); + id = attr_rel; + $.get('../op/op.Ajax.php', + { command: 'tooglelockdocument', id: id }, + function(data) { + console.log(data); + if(data.success) { + $("#table-row-document-"+id).html('Loading').load('../op/op.Ajax.php?command=view&view=documentlistrow&id='+id) + noty({ + text: attr_msg, + type: 'success', + dismissQueue: true, + layout: 'topRight', + theme: 'defaultTheme', + timeout: 1500, + }); + } else { + noty({ + text: data.message, + type: 'error', + dismissQueue: true, + layout: 'topRight', + theme: 'defaultTheme', + timeout: 3500, + }); + } + }, + 'json' + ); + }); + $('a.movefolder').click(function(ev){ ev.preventDefault(); attr_source = $(ev.currentTarget).attr('source');