How to use the backbone.radio.channel 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 encryptic-team / encryptic / src / scripts / components / notes / list / Controller.js View on Github external
listenToEvents() {
        this.view.collection.startListening();

        // Show note form on "c" keybinding
        this.listenTo(Radio.channel('utils/Keybindings'), 'appCreateNote',
            this.navigateForm);

        // Show note form if add buttons in the navbar is clicked
        this.listenTo(Radio.channel('components/navbar'), 'show:form',
            this.navigateForm);

        // Open a note on model:navigate event
        this.listenTo(this.view.collection.channel, 'model:navigate',
            _.debounce(this.navigateModel, 420));

        // Destroy itself if the view is destroyed
        this.listenTo(this.view, 'destroy', this.destroy);
    }
github encryptic-team / encryptic / src / scripts / components / importExport / main.js View on Github external
function initialize() {
    Radio.channel('components/importExport')
    .reply({
        import         : (...args) => new Import(...args).init(),
        importEvernote : (...args) => new ImportEvernote(...args).init(),
        export         : (...args) => new Export(...args).init(),
    });

    Radio.request('utils/Initializer', 'add', {
        name     : 'App:last',
        callback : () => new Migrate().init(),
    });
}
github snapcore / snapweb / www / src / js / controllers / token.js View on Github external
index: function() {
    var chan = Radio.channel('root');
    var model = new AccessToken();
    var view = new SubmitTokenView({
      model: model,
    });
    chan.command('set:content', {backboneView: view});
  }
};
github Laverna / laverna / app / scripts / collections / modules / Notes.js View on Github external
find(options) {
        const sortField = Radio.channel('collections/Configs').request(
            'findConfig', {name: 'sortnotes'}
        );
        const opt = _.extend({sortField}, options);

        return super.find(opt);
    }
github kilbot / WooCommerce-POS / assets / js / src / lib / config / application.js View on Github external
_initChannel: function () {
    this.channelName = _.result(this, 'channelName') || 'global';
    this.channel = _.result(this, 'channel') ||
    Radio.channel(this.channelName);
  },
github snapcore / snapweb / www / src / js / controllers / snaps.js View on Github external
var $ = require('jquery');
var Backbone = require('backbone');
Backbone.$ = $;
var _ = require('lodash');
var Radio = require('backbone.radio');
var React = require('react');
var SnapDetailsView = require('../views/snap-details.js');
var DeviceInfo = require('../models/device-info.js');
var Snap = require('../models/snap.js');
var SnapTools = require('../common/snaps.js')

var snapChannel = Radio.channel('snap');
var rootChannel = Radio.channel('root');

var byteSizeToString = function(s) {
  var suffixes = ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB'];
  for (var i in suffixes) {
    if (s < 1000) {
      return s.toFixed(2) + suffixes[i];
    }
    s /= 1000;
  }
  return s;
};

var showSnapView = function(snap, deviceInfo) {
  var size = snap.get('installed_size')
      || snap.get('download_size');
github Laverna / laverna / app / scripts / components / importExport / Import.js View on Github external
get channel() {
        return Radio.channel('components/importExport');
    }
github encryptic-team / encryptic / src / scripts / components / navbar / View.js View on Github external
get channel() {
        return Radio.channel('components/navbar');
    }
github encryptic-team / encryptic / src / scripts / components / importExport / Import.js View on Github external
get channel() {
        return Radio.channel('components/importExport');
    }