(scheduler2, dp)
| 7791 | })(); |
| 7792 | } |
| 7793 | function DataProcessorEvents(scheduler2, dp) { |
| 7794 | this.$scheduler = scheduler2; |
| 7795 | this.$dp = dp; |
| 7796 | this._dataProcessorHandlers = []; |
| 7797 | this.attach = function() { |
| 7798 | var dp2 = this.$dp; |
| 7799 | var scheduler3 = this.$scheduler; |
| 7800 | this._dataProcessorHandlers.push(scheduler3.attachEvent("onEventAdded", function(id) { |
| 7801 | if (!this._loading && this._validId(id)) |
| 7802 | dp2.setUpdated(id, true, "inserted"); |
| 7803 | })); |
| 7804 | this._dataProcessorHandlers.push(scheduler3.attachEvent("onConfirmedBeforeEventDelete", function(id) { |
| 7805 | if (!this._validId(id)) |
| 7806 | return; |
| 7807 | var z = dp2.getState(id); |
| 7808 | if (z == "inserted" || this._new_event) { |
| 7809 | dp2.setUpdated(id, false); |
| 7810 | return true; |
| 7811 | } |
| 7812 | if (z == "deleted") |
| 7813 | return false; |
| 7814 | if (z == "true_deleted") |
| 7815 | return true; |
| 7816 | dp2.setUpdated(id, true, "deleted"); |
| 7817 | return false; |
| 7818 | })); |
| 7819 | this._dataProcessorHandlers.push(scheduler3.attachEvent("onEventChanged", function(id) { |
| 7820 | if (!this._loading && this._validId(id)) |
| 7821 | dp2.setUpdated(id, true, "updated"); |
| 7822 | })); |
| 7823 | this._dataProcessorHandlers.push(scheduler3.attachEvent("onClearAll", function() { |
| 7824 | dp2._in_progress = {}; |
| 7825 | dp2._invalid = {}; |
| 7826 | dp2.updatedRows = []; |
| 7827 | dp2._waitMode = 0; |
| 7828 | })); |
| 7829 | dp2.attachEvent("insertCallback", scheduler3._update_callback); |
| 7830 | dp2.attachEvent("updateCallback", scheduler3._update_callback); |
| 7831 | dp2.attachEvent("deleteCallback", function(upd, id) { |
| 7832 | if (scheduler3.getEvent(id)) { |
| 7833 | scheduler3.setUserData(id, this.action_param, "true_deleted"); |
| 7834 | scheduler3.deleteEvent(id); |
| 7835 | } else if (scheduler3._add_rec_marker) |
| 7836 | scheduler3._update_callback(upd, id); |
| 7837 | }); |
| 7838 | }; |
| 7839 | this.detach = function() { |
| 7840 | for (var key in this._dataProcessorHandlers) { |
| 7841 | var handler = this._dataProcessorHandlers[key]; |
| 7842 | this.$scheduler.detachEvent(handler); |
| 7843 | } |
| 7844 | this._dataProcessorHandlers = []; |
| 7845 | }; |
| 7846 | } |
| 7847 | function extendScheduler(scheduler2, dp) { |
| 7848 | scheduler2._validId = function(id) { |
| 7849 | if (this._is_virtual_event) { |
nothing calls this directly
no test coverage detected