View | Details | Raw Unified | Return to bug 20714
Collapse All | Expand All

(-)a/management/univention-management-console-frontend/umc/app.js (-1 / +47 lines)
 Lines 57-62   define([ Link Here 
57
	"dojo/dom-geometry",
57
	"dojo/dom-geometry",
58
	"dojo/dom-construct",
58
	"dojo/dom-construct",
59
	"dojo/date/locale",
59
	"dojo/date/locale",
60
	"dojo/hash",
60
	"dojox/html/styles",
61
	"dojox/html/styles",
61
	"dojox/html/entities",
62
	"dojox/html/entities",
62
	"dojox/gfx",
63
	"dojox/gfx",
 Lines 88-94   define([ Link Here 
88
	"dojo/sniff" // has("ie"), has("ff")
89
	"dojo/sniff" // has("ie"), has("ff")
89
], function(declare, lang, kernel, array, baseFx, baseWin, win, on, aspect, has,
90
], function(declare, lang, kernel, array, baseFx, baseWin, win, on, aspect, has,
90
		Evented, Deferred, when, all, cookie, topic, ioQuery, fx, fxEasing, Memory, Observable,
91
		Evented, Deferred, when, all, cookie, topic, ioQuery, fx, fxEasing, Memory, Observable,
91
		dom, style, domAttr, domClass, domGeometry, domConstruct, locale, styles, entities, gfx, registry, tools, dialog, store,
92
		dom, style, domAttr, domClass, domGeometry, domConstruct, locale, hash, styles, entities, gfx, registry, tools, dialog, store,
92
		Menu, MenuItem, PopupMenuItem, MenuSeparator, Tooltip, DropDownButton, StackContainer,
93
		Menu, MenuItem, PopupMenuItem, MenuSeparator, Tooltip, DropDownButton, StackContainer,
93
		TabController, LiveSearchSidebar, GalleryPane, ContainerWidget, Page, Form, Button, Text, Module, ModuleHeader, CategoryButton,
94
		TabController, LiveSearchSidebar, GalleryPane, ContainerWidget, Page, Form, Button, Text, Module, ModuleHeader, CategoryButton,
94
		i18nTools, _
95
		i18nTools, _
 Lines 96-101   define([ Link Here 
96
	// cache UCR variables
97
	// cache UCR variables
97
	var _ucr = {};
98
	var _ucr = {};
98
	var _favoritesDisabled = false;
99
	var _favoritesDisabled = false;
100
	var _initialHash = hash();
99
101
100
	var _getLang = function() {
102
	var _getLang = function() {
101
		return kernel.locale.split('-')[0];
103
		return kernel.locale.split('-')[0];
 Lines 1080-1087   define([ Link Here 
1080
				if (!newModule.moduleID) {
1082
				if (!newModule.moduleID) {
1081
					// this is the overview page, not a module
1083
					// this is the overview page, not a module
1082
					topic.publish('/umc/actions', 'overview');
1084
					topic.publish('/umc/actions', 'overview');
1085
					this._lastHash = '';
1086
					hash(this._lastHash);
1083
				} else if (!newModule.$isDummy$) {
1087
				} else if (!newModule.$isDummy$) {
1084
					topic.publish('/umc/actions', newModule.moduleID, newModule.moduleFlavor, 'focus');
1088
					topic.publish('/umc/actions', newModule.moduleID, newModule.moduleFlavor, 'focus');
1089
					this._lastHash = 'module=' + encodeURIComponent(newModule.moduleID + (newModule.moduleFlavor ? ':' + newModule.moduleFlavor : ''));
1090
					hash(this._lastHash);
1085
				}
1091
				}
1086
				var overviewShown = (newModule === this._overviewPage);
1092
				var overviewShown = (newModule === this._overviewPage);
1087
				this._header.toggleBackToOverviewVisibility(!overviewShown);
1093
				this._header.toggleBackToOverviewVisibility(!overviewShown);
 Lines 1345-1356   define([ Link Here 
1345
			// setup menus
1351
			// setup menus
1346
			this._header.setupGui();
1352
			this._header.setupGui();
1347
			this._setupOverviewPage();
1353
			this._setupOverviewPage();
1354
			this._setupHashing();
1348
1355
1349
			// set a flag that GUI has been build up
1356
			// set a flag that GUI has been build up
1350
			tools.status('setupGui', true);
1357
			tools.status('setupGui', true);
1351
			this.onGuiDone();
1358
			this.onGuiDone();
1352
		},
1359
		},
1353
1360
1361
		_reCategory: /^category=(.*)$/,
1362
		_reModule: /^module=(.*)$/,
1363
		_ignoreHashEvents: false,
1364
		_setupHashing: function() {
1365
			topic.subscribe('/dojo/hashchange', lang.hitch(this, function(hash) {
1366
				console.log('###', hash);
1367
				if (this._lastHash == hash) {
1368
					return;
1369
				}
1370
				if (!hash) {
1371
					this.switchToOverview();
1372
					return;
1373
				}
1374
				var match = hash.match(this._reModule);
1375
				if (match) {
1376
					try {
1377
						var moduleString = decodeURIComponent(match[1]);
1378
						var moduleParts = moduleString.split(':');
1379
						var moduleID = moduleParts[0];
1380
						var moduleFlavor = moduleParts.length > 1 ? moduleParts[1] : null;
1381
						var foundTab = array.some(this._tabContainer.getChildren(), function(itab) {
1382
							if (itab.moduleID == moduleID && itab.moduleFlavor == moduleFlavor) {
1383
								this.focusTab(itab);
1384
								return true;
1385
							}
1386
						}, this);
1387
						if (!foundTab) {
1388
							this._lastHash = _initialHash;
1389
							this.openModule(moduleID, moduleFlavor);
1390
						}
1391
					} catch(e) { }
1392
				}
1393
			}));
1394
1395
			if (_initialHash) {
1396
				hash(_initialHash, true);
1397
			}
1398
		},
1399
1354
		_setupOverviewPage: function() {
1400
		_setupOverviewPage: function() {
1355
			if (!tools.status('overview')) {
1401
			if (!tools.status('overview')) {
1356
				// no overview page is being displayed
1402
				// no overview page is being displayed

Return to bug 20714