Commit 2b6b2a53 authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Mueve módulo de selección, limpia métodos

Se desplaza al módulo global de selección desde el directorio base de
módulos (que solo debe usarse para extensiones de las que hereden o
deriven otros módulos, no para módulos completos) a su propio
directorio.

Se prescinde de métodos disponibles para implementar, ya que no aportan
nada.
parent 3883d1ef
Loading
Loading
Loading
Loading
+2 −15
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@ define([
	, _Selection
	, put
) {

	return declare(_Selection, {
		//	summary:
		//		Extensión para añadir selection al la vista de detalles
@@ -87,20 +88,6 @@ define([

			this._selectItem = false;
			this._checkBoxNode.setAttribute("class", this._classDefaultSelection + "square-o");
		},

		_getItemToSelect: function(ids) {

			return {
				items: ids
			};
		},

		_getItemToDeselect: function(ids) {

			return {
				items: ids
			};
		}
	});
});
+1 −1
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@ define([
	, 'dojo/on'
	, 'put-selector/put'
	, 'redmic/base/Credentials'
	, 'redmic/modules/base/Selector'
	, 'redmic/modules/selector/Selector'
	, 'redmic/modules/components/Sidebar/MainSidebarImpl'
	, 'redmic/modules/store/RestManagerImpl'
	, 'redmic/modules/notification/Notification'
+2 −55
Original line number Diff line number Diff line
@@ -95,18 +95,6 @@ define([
						'icon': 'fa-eraser',
						'callback': '_clearSelectionButtonCallback',
						'condition': lang.hitch(this, this._isShowItem)
					},{
						'label': this.i18n.selectAll,
						'value': 'selectAll',
						'icon': 'fa-check',
						'callback': '_selectAllButtonCallback',
						'condition': lang.hitch(this, this._isShowItem)
					},{
						'label': this.i18n.reverseSelection,
						'value': 'reverseSelection',
						'icon': 'fa-exchange',
						'callback': '_reverseSelectionButtonCallback',
						'condition': lang.hitch(this, this._isShowItem)
					},{
						'label': this.i18n.restoreSelection,
						'value': 'restoreSelection',
@@ -240,11 +228,6 @@ define([
			this._publish(this.loadSelection.getChannel("HIDE"));
		},

		_getNodeToShow: function() {

			return this.domNode;
		},

		_subRefresh: function(request) {
			//	summary:
			//		Se ejecuta cada vez que se cambia la vista principal para refescar
@@ -276,20 +259,12 @@ define([

		_isShowItem: function(item) {

			if (!this.itemsShow || (this.itemsShow && this.itemsShow[item.value])) {
				return true;
			}

			return false;
			return !this.itemsShow || (this.itemsShow && this.itemsShow[item.value]);
		},

		_exitsPermsCorrect: function(item) {

			if (this.perms > 1 && this._isShowItem(item)) {
				return true;
			}

			return false;
			return this.perms > 1 && this._isShowItem(item);
		},

		_select: function(item, total) {
@@ -504,34 +479,6 @@ define([
					label: "clearSelection"
				}
			});
		},

		_selectAllButtonCallback: function() {

			this._emitEvt('SELECT_ALL');

			this._emitEvt('TRACK', {
				type: TRACK.type.event,
				info: {
					category: TRACK.category.button,
					action: TRACK.action.click,
					label: "selectAll"
				}
			});
		},

		_reverseSelectionButtonCallback: function() {

			this._emitEvt('REVERSE');

			this._emitEvt('TRACK', {
				type: TRACK.type.event,
				info: {
					category: TRACK.category.button,
					action: TRACK.action.click,
					label: "reverseSelection"
				}
			});
		}
	});
});
+12 −8
Original line number Diff line number Diff line
@@ -296,18 +296,22 @@ define([

		_pubSelect: function(channel, ids) {

			when(this._getItemToSelect(ids), lang.hitch(this, function(obj) {
				obj.selectionTarget = this._getSelectionTarget();
			var obj = {
				items: ids,
				selectionTarget: this._getSelectionTarget()
			};

			this._publish(channel, obj);
			}));
		},

		_pubDeselect: function(channel, ids) {

			when(this._getItemToDeselect(ids), lang.hitch(this, function(obj) {
				obj.selectionTarget = this._getSelectionTarget();
			var obj = {
				items: ids,
				selectionTarget: this._getSelectionTarget()
			};

			this._publish(channel, obj);
			}));
		},

		_pubGroupSelected: function(channel) {
+0 −1
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@ define([
				"_select": {},
				"_deselect": {},
				"_clearSelection": {},
				"_getItemToSelectOrDeselect": {},
				"_checkSelectionAfterShown": {},
				"_totalAvailable": {}
			});
Loading