/**
 * Replicates the complete event from Infragistics' WARP. <code>InfraWebRefreshPanel.complete()</code> needs to be called from within the inline code which handles the complete event. See ItemDetail for an example.
 * @class dtIgEventReplicator
 **/

/*jslint strict:false*/
/*global DT:false, window:false*/

DT.CORE.register('dtIgEventReplicator', function (io, $) {
	return {
		init: function () {
			var rp = window.InfraWebRefreshPanel = window.InfraWebRefreshPanel || {},
				complete;
			complete = rp.complete;
			rp.complete = function () {
				var args = Array.prototype.slice.call(arguments);
				io.notify(DT.CONSTANTS.EVENT_LAYOUT_CHANGED);
				io.notify(DT.CONSTANTS.EVENT_PARTIAL_REFRESH);
				complete.apply(this, args);
			};
		}
	};
});
