Skip to content

Commit

Permalink
Fixed a bug in tablesorter such that after a search or a pagination e…
Browse files Browse the repository at this point in the history
…vent, the delete, preview, and edit in place buttons didn't work.
  • Loading branch information
paustian committed Feb 4, 2020
1 parent 8b30985 commit 1934933
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
3 changes: 3 additions & 0 deletions Controller/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ protected function postInitialize() {
*/
public function indexAction(Request $request) {

if (!$this->hasPermission($this->name . '::', '::', ACCESS_ADD)) {
throw new AccessDeniedException();
}
// Return a page of menu items.
return $this->render('PaustianQuickcheckModule:Admin:quickcheck_admin_menu.html.twig');
}
Expand Down
12 changes: 9 additions & 3 deletions Resources/public/js/Paustian.Quickcheck.moderatequestions.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,27 @@
},

init: function () {
$("#tableToSort").on("draw.dt", this.cacheDomAndBindEvents.bind(this));
this.cacheDomAndBindEvents();
},

cacheDomAndBindEvents: function(){
this.cacheDom();
this.bindEvents();
},

cacheDom: function () {
this.$deleteButtons = $('span[id^=delete_]');
this.$editButtons = $('span[id^=edit_]');
this.$deleteButtons = $("span[id^=delete_]");
this.$editButtons = $("span[id^=edit_]");
this.$table = $("#tableToSort");
var divDeleteRowsExists = $('#delete_rows');
var divDeleteRowsExists = $("#delete_rows");
this.$deleteRows = (divDeleteRowsExists.length !== 0);
},

bindEvents: function () {
this.$deleteButtons.on('click', this.deleteQuestion.bind(this));
this.$editButtons.on('click', this.editQuestion.bind(this));

},

deleteQuestion: function (evt){
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{{ pageAddAsset('javascript', zasset('jquery-ui/jquery-ui.js')) }}
{{ pageAddAsset('stylesheet', asset('jquery-ui/themes/base/jquery-ui.min.css')) }}
{{ pageAddAsset('stylesheet', 'https://cdn.datatables.net/1.10.19/css/jquery.dataTables.css') }}
{{ pageAddAsset('javascript', 'https://cdn.datatables.net/1.10.19/js/jquery.dataTables.js') }}
{{ pageAddAsset('stylesheet', 'https://cdn.datatables.net/1.10.20/css/jquery.dataTables.css') }}
{{ pageAddAsset('javascript', 'https://cdn.datatables.net/1.10.20/js/jquery.dataTables.js') }}
{{ pageAddAsset('javascript', zasset('@PaustianQuickcheckModule:js/Paustian.Quickcheck.moderatequestions.js')) }}
{{ pageAddAsset('javascript', zasset('@PaustianQuickcheckModule:js/Paustian.Quickcheck.viewquestion.js')) }}

{{ render(controller('ZikulaAdminModule:Admin:adminheader')) }}

<h3> {{ __('Current Questions for Moderation') }}</h3>
Expand Down

0 comments on commit 1934933

Please sign in to comment.