settings.js 751 B

1234567891011121314151617181920
  1. /* TEST PLUGIN SETTINGS JS FILE */
  2. /* This file is only loaded on the Organizr settings page */
  3. // FUNCTIONS
  4. // EVENTS and LISTENERS
  5. // If you setup the plugin not use the bind settings function ('bind' => false) - You can override the js settings pane if you wish like this:
  6. // REPLACE PLUGINNAME and pluginname with the actual name
  7. $(document).on('click', '#PLUGINNAME-settings-button', function() {
  8. ajaxloader(".content-wrap","in");
  9. organizrAPI2('GET','api/v2/plugins/pluginname/settings').success(function(data) {
  10. let response = data.response;
  11. $('#PLUGINNAME-settings-items').html(buildFormGroup(response.data));
  12. // And any other items you want to do things with
  13. }).fail(function(xhr) {
  14. OrganizrApiError(xhr);
  15. });
  16. ajaxloader();
  17. });