main.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. (function ($) {
  2. //Notification handler
  3. abp.event.on('abp.notifications.received', function (userNotification) {
  4. abp.notifications.showUiNotifyForUserNotification(userNotification);
  5. //Desktop notification
  6. Push.create("RodChange", {
  7. body: userNotification.notification.data.message,
  8. icon: abp.appPath + 'images/app-logo-small.png',
  9. timeout: 6000,
  10. onClick: function () {
  11. window.focus();
  12. this.close();
  13. }
  14. });
  15. });
  16. //serializeFormToObject plugin for jQuery
  17. $.fn.serializeFormToObject = function () {
  18. //serialize to array
  19. var data = $(this).serializeArray();
  20. //add also disabled items
  21. $(':disabled[name]', this).each(function () {
  22. data.push({ name: this.name, value: $(this).val() });
  23. });
  24. //map to object
  25. var obj = {};
  26. data.map(function (x) { obj[x.name] = x.value; });
  27. return obj;
  28. };
  29. //Configure blockUI
  30. if ($.blockUI) {
  31. $.blockUI.defaults.baseZ = 2000;
  32. }
  33. })(jQuery);