mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-10 21:28:04 +02:00
--HG-- rename : static/shared/README.md => browser/components/loop/content/shared/README.md rename : static/shared/css/common.css => browser/components/loop/content/shared/css/common.css rename : static/shared/css/conversation.css => browser/components/loop/content/shared/css/conversation.css rename : static/shared/css/panel.css => browser/components/loop/content/shared/css/panel.css rename : static/shared/css/readme.html => browser/components/loop/content/shared/css/readme.html rename : static/shared/img/icon_32.png => browser/components/loop/content/shared/img/icon_32.png rename : static/shared/img/icon_64.png => browser/components/loop/content/shared/img/icon_64.png rename : static/shared/js/models.js => browser/components/loop/content/shared/js/models.js rename : static/shared/js/views.js => browser/components/loop/content/shared/js/views.js rename : static/shared/libs/backbone-1.1.2.js => browser/components/loop/content/shared/libs/backbone-1.1.2.js rename : static/shared/libs/jquery-2.1.0.js => browser/components/loop/content/shared/libs/jquery-2.1.0.js rename : static/shared/libs/lodash-2.4.1.js => browser/components/loop/content/shared/libs/lodash-2.4.1.js rename : static/shared/libs/sdk.js => browser/components/loop/content/shared/libs/sdk.js rename : static/shared/libs/webl10n-20130617.js => browser/components/loop/content/shared/libs/webl10n-20130617.js rename : static/css/webapp.css => browser/components/loop/standalone/content/css/webapp.css rename : static/index.html => browser/components/loop/standalone/content/index.html rename : static/js/webapp.js => browser/components/loop/standalone/content/js/webapp.js rename : static/l10n/data.ini => browser/components/loop/standalone/content/l10n/data.ini rename : test/webapp_test.js => browser/components/loop/test/standalone/webapp_test.js extra : transplant_source : %DA%D9%3A%E9%C6%E0d%13%84%C1%BEps%C8b%F09o%D7m
37 lines
918 B
JavaScript
37 lines
918 B
JavaScript
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
/* global loop:true */
|
|
|
|
var loop = loop || {};
|
|
loop.shared = loop.shared || {};
|
|
loop.shared.router = (function() {
|
|
"use strict";
|
|
|
|
/**
|
|
* Base Router. Allows defining a main active view and ease toggling it when
|
|
* the active route changes.
|
|
*
|
|
* @link http://mikeygee.com/blog/backbone.html
|
|
*/
|
|
var BaseRouter = Backbone.Router.extend({
|
|
activeView: undefined,
|
|
|
|
/**
|
|
* Loads and render current active view.
|
|
*
|
|
* @param {loop.shared.views.BaseView} view View.
|
|
*/
|
|
loadView : function(view) {
|
|
if (this.activeView) {
|
|
this.activeView.hide();
|
|
}
|
|
this.activeView = view.render().show();
|
|
}
|
|
});
|
|
|
|
return {
|
|
BaseRouter: BaseRouter
|
|
};
|
|
})();
|