Commit aec6defb authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Añade módulo para (des)habilitar modo fullscreen

parent a848749b
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ define([
	, 'redmic/modules/socket/_Worms'
	, 'redmic/modules/socket/Socket'
	, 'redmic/modules/socket/Task'
	, 'redmic/modules/user/FullscreenToggle'
	, 'redmic/modules/user/LanguageSelector'
	, 'redmic/modules/user/UserArea'
], function(
@@ -46,6 +47,7 @@ define([
	, _Worms
	, Socket
	, Task
	, FullscreenToggle
	, LanguageSelector
	, UserArea
) {
@@ -147,6 +149,10 @@ define([
				node: topbarRightNode
			});

			this._publish(this.fullscreenToggle.getChannel('SHOW'), {
				node: topbarRightNode
			});

			this._publish(this.languageSelector.getChannel('SHOW'), {
				node: topbarRightNode
			});
@@ -253,6 +259,10 @@ define([
			this.languageSelector = new LanguageSelector({
				parentChannel: this.ownChannel
			});

			this.fullscreenToggle = new FullscreenToggle({
				parentChannel: this.ownChannel
			});
		},

		_createStructure: function() {
@@ -350,6 +360,7 @@ define([

			// TODO reemplazo a destroy de todo 'app', eliminar cuando router no comparta canal y destruir solo 'app'
			this._publish(this.sidebar.getChannel('DESTROY'));
			this._publish(this.fullscreenToggle.getChannel('DESTROY'));
			this._publish(this.languageSelector.getChannel('DESTROY'));
			this._publish(this.userArea.getChannel('DESTROY'));

+56 −0
Original line number Diff line number Diff line
define([
	'dojo/_base/declare'
	, 'dojo/_base/lang'
	, 'put-selector/put'
	, 'redmic/modules/base/_Module'
	, 'redmic/modules/base/_Show'
], function(
	declare
	, lang
	, put
	, _Module
	, _Show
) {

	return declare([_Module, _Show], {
		//	summary:
		//		Módulo habilitador de pantalla completa.
		//	description:
		//		Cambia entre pantalla completa y modo normal.

		constructor: function(args) {

			this.config = {
				ownChannel: 'fullscreenToggle',
				'class': 'fullscreenToggle'
			};

			lang.mixin(this, this.config, args);
		},

		postCreate: function() {

			this.inherited(arguments);

			put(this.domNode, '[title=$]', this.i18n.fullscreen);

			this.iconNode = put(this.domNode, 'i');

			this.domNode.onclick = lang.hitch(this, this._fullscreenOnClick);
		},

		_fullscreenOnClick: function(evt) {

			if (this.ownerDocument.fullscreenElement) {
				this.ownerDocument.exitFullscreen();
			} else {
				this.ownerDocumentBody.requestFullscreen();
			}
		},

		_getNodeToShow: function() {

			return this.domNode;
		}
	});
});
+13 −14
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ define([
	, _ShowOnEvt
	, ListMenu
) {

	return declare([_Module, _Show], {
		//	summary:
		//		Módulo selector de idioma.
@@ -30,7 +31,8 @@ define([
		constructor: function(args) {

			this.config = {
				ownChannel: 'languageSelector'
				ownChannel: 'languageSelector',
				'class': 'languageSelector'
			};

			lang.mixin(this, this.config, args);
@@ -56,12 +58,6 @@ define([

		_initialize: function() {

			put(this.domNode, '.languageSelector');

			this.containerNode = put(this.domNode, 'div[title=$]', this.i18n.language);

			this.iconNode = put(this.containerNode, 'i.fa.fa-language');

			this.listMenu = new declare([ListMenu, _ShowOnEvt]).extend(_ShowInTooltip)(this.listMenuConfig);
		},

@@ -75,18 +71,21 @@ define([

		postCreate: function() {

			this.inherited(arguments);

			put(this.domNode, '[title=$]', this.i18n.language);
			put(this.domNode, 'i.fa.fa-language');

			this._publish(this.listMenu.getChannel('ADD_EVT'), {
				sourceNode: this.iconNode
				sourceNode: this.domNode
			});

			this.inherited(arguments);
		},

		_subEventItem: function(response) {
		_subEventItem: function(res) {

			var cbk = response.callback;
			var cbk = res.callback;

			cbk && this[cbk](response);
			cbk && this[cbk](res);
		},

		_changeLanguage: function(itemObj) {
Compare 727f37df to fbef49e0
Original line number Diff line number Diff line
Subproject commit 727f37dfd74b39d19bc4f1a4fe03804f74b65747
Subproject commit fbef49e0ca8e4ce86496c857857250bfd8f7737d