How to use the backbone.marionette.LayoutView function in backbone

To help you get started, we’ve selected a few backbone examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nusmodifications / nusmods / app / scripts / contribute / views / ReviewersView.js View on Github external
var template = require('../templates/reviewers.hbs');
// var itemTemplate = require('../templates/reviewers_item.hbs');

// var ReviewersItemView = Marionette.ItemView.extend({
//   tagName: 'div',
//   className: 'nm-ct-rev-item col-md-3 col-sm-3 col-xs-4',
//   template: itemTemplate
// });

// var ReviewersListView = Marionette.CollectionView.extend({
//   tagName: 'div',
//   className: 'nm-ct-revs',
//   childView: ReviewersItemView
// });

module.exports = Marionette.LayoutView.extend({
  initialize: function () {
    this.model = new Backbone.Model();
    // temporary using developer list lol
    // this.model.set('revsUrl', 'https://api.github.com/repos/NUSModifications/NUSMods/contributors');
  },
  template: template,
  regions: {
    reviewersRegion: '.nm-ct-revs-container'
  },
  onShow: function () {
    // this.reviewersCollection = new Backbone.Collection();
    // this.reviewersListView = new ReviewersListView({collection: this.reviewersCollection});
    // var _this = this;
    // $.get(_this.model.get('revsUrl'), function (items) {
    //   _this.reviewersCollection.add(items);
    // });
github rcommande / papaye / papaye / static / src / main / js / views / app.view.js View on Github external
import Marionette from 'backbone.marionette';
import Handlebars from 'handlebars';

import NavbarView from './navbar.view';
import BreadcrumbView from './breadcrumb.view';

import appTemplate from '../../templates/app.template.html!text';

import 'bootstrap/dist/css/bootstrap.css!';
import 'ubuntu-fontface/ubuntu.css!';
import 'font-awesome/css/font-awesome.min.css!';


const AppView = Marionette.LayoutView.extend({
    template: Handlebars.compile(appTemplate),

    ui: {
        navbar: '.navbar-placeholder',
        content: '.content-placeholder',
        breadcrumb: '.breadcrumb-placeholder',
    },

    regions: {
        navbar: '@ui.navbar',
        content: '@ui.content',
        breadcrumb: '@ui.breadcrumb',
    },

    initialize(options) {
        console.log(options);
github ipoddubny / webcdr / public / js / main.js View on Github external
require('./cdr');
require('./admin');

var ModalRegion = Marionette.Region.extend({
  el: '#modal',

  onShow: function (view) {
    this.$el.find('.modal').modal();
  },

  hide: function () {
    this.$el.find('.modal').modal('hide');
  }
});

var RootView = Marionette.LayoutView.extend({
  el: 'body',

  regions: {
    navigation: '#navigation',
    main: '#main',
    modal: ModalRegion
  }
});

app.rootView = new RootView();

app.on('start', function (options) {
  app.navcol = new Backbone.Collection([{
    name: $$('Calls'),
    icon: 'fa-bars',
    target: 'cdr',
github SonarSource / sonarqube / server / sonar-web / src / main / js / apps / groups / layout.js View on Github external
* License as published by the Free Software Foundation; either
 * version 3 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
import Marionette from 'backbone.marionette';
import Template from './templates/groups-layout.hbs';

export default Marionette.LayoutView.extend({
  template: Template,

  regions: {
    headerRegion: '#groups-header',
    searchRegion: '#groups-search',
    listRegion: '#groups-list',
    listFooterRegion: '#groups-list-footer'
  }
});
github SonarSource / sonarqube / server / sonar-web / src / main / js / apps / computation / layout.js View on Github external
import Marionette from 'backbone.marionette';
import './templates';

export default Marionette.LayoutView.extend({
  template: Templates['computation-layout'],

  regions: {
    headerRegion: '#computation-header',
    searchRegion: '#computation-search',
    listRegion: '#computation-list',
    listFooterRegion: '#computation-list-footer'
  }
});
github mapcontrib / mapcontrib / public / js / view / info / layer / gpxColumn.js View on Github external
import Wreqr from 'backbone.wreqr';
import Marionette from 'backbone.marionette';
import MarkedHelper from 'helper/marked';
import template from 'templates/info/layer/gpxColumn.ejs';
import LeafletHelper from 'helper/leaflet';
import Locale from 'core/locale';

export default Marionette.LayoutView.extend({
  template,

  behaviors() {
    return {
      l20n: {},
      column: {
        appendToBody: true,
        destroyOnClose: true,
        routeOnClose: this.options.previousRoute
      }
    };
  },

  ui: {
    descriptionSection: '.description_section',
    downloadBtn: '.download_btn',
github openl10n / openl10n / client / src / project / views / index-view.js View on Github external
var $ = require('jquery');
var Marionette = require('backbone.marionette');

module.exports = Marionette.LayoutView.extend({
  template: require('../templates/index'),
  tagName: 'div',
  className: 'inner',

  regions: {
    languageListRegion: '#languages-list',
    resourceListRegion: '#resource-list',
  },

  onShow: function() {
    var _this = this;

    var $window = $(window);
    var $el = this.$el.find('.js-scrollable');

    var updateBlockHeight = function UpdateBlockHeight() {
github mapcontrib / mapcontrib / public / js / ui / form / tagType / index.js View on Github external
import Marionette from 'backbone.marionette';
import template from './template.ejs';


export default Marionette.LayoutView.extend({
    template,

    tagName: 'select',
    className: 'form-control',

    behaviors() {
        return {
            l20n: {},
        };
    },

    onRender() {
        if (this.options.value) {
            this.$el.val(this.options.value);
        }
    },
github mmukhin / badmin / src / js / views / nav / view.js View on Github external
'use strict';

var _ = require('underscore');
var Backbone = require('backbone');
var Marionette = require('backbone.marionette');
var UserMenuView = require('../users/user-menu.js');

module.exports = Marionette.LayoutView.extend({
    id: 'nav',
    template: require('../../templates/nav/nav.hbs'),
    regions: {
        userView: '#region-user'
    },
    render: function(){
        this.$el.html(this.template());
        this.userView.show( new UserMenuView({model: TheApp.app.user}) );
        return this;
    }
});
github nusmodifications / nusmods / app / scripts / modules / views / ModuleView.js View on Github external
var Marionette = require('backbone.marionette');
var PrerequisitesTreeView = require('./PrerequisitesTreeView');
var PrerequisitesUnavailableView = require('./PrerequisitesUnavailableView');
var _ = require('underscore');
var analytics = require('../../analytics');
var localforage = require('localforage');
var template = require('../templates/module.hbs');
var config = require('../../common/config');
var DISQUSWIDGETS = require('../../disqus-count');
require('bootstrap/scrollspy');
require('bootstrap/affix');
require('bootstrap/tab');

var preferencesNamespace = config.namespaces.preferences + ':';

module.exports = Marionette.LayoutView.extend({
  template: template,
  ui: {
    backToTopButton: '#back-to-top'
  },
  behaviors: {
    GoToTopBehavior: {
      behaviorClass: GoToTopBehavior
    },
    ModuleHoverBehavior: {
      behaviorClass: ModuleHoverBehavior
    }
  },
  regions: {
    biddingStatsRegion: '#bidding-stats',
    prerequisitesTreeRegion: '.nm-prerequisites-tree'
  },