How to use the backbone.trigger 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 categolj / categolj2-backend / src / main / resources / static / resources / app / js / admin / main.js View on Github external
}).on('ajaxError', function (event, xhr) {
            console.log(arguments);
            var resp = xhr.responseJSON;
            if (xhr.status == 401 && resp.error == "invalid_token") {
                // TODO refresh token
                alert(resp.error_description);
                location.href = "logout";
            }
            if (xhr.status == 403) {
                if (_.isArray(resp.details)) {
                    Backbone.trigger('exception', resp.details[0]);
                }
            }
        });
github orizens / echoes / src / BACKBONE / libs / backbone / backbone.safe.js View on Github external
var init = function() {
	Backbone.trigger('extend:Model', {
		key: 'safe',
		extension: Safe,
		initialize: function () {
			this.trigger('after:initialize');
		}
	});

	Backbone.trigger('extend:Collection', {
		key: 'safe',
		extension: Safe,
		initialize: function () {
			this.trigger('after:initialize');
		}
	});
};
github keeweb / keeweb / app / scripts / comp / app / single-instance-checker.js View on Github external
storageChanged(e) {
        if (!e.newValue) {
            return;
        }
        if (e.key === LocalStorageKeyName && e.newValue !== instanceKey) {
            SingleInstanceChecker.setKey(
                LocalStorageResponseKeyName,
                instanceKey + Math.random().toString()
            );
        } else if (e.key === LocalStorageResponseKeyName && e.newValue.indexOf(instanceKey) < 0) {
            window.removeEventListener('storage', SingleInstanceChecker.storageChanged);
            Backbone.trigger('second-instance');
        }
    },
github oroinc / platform / src / Oro / Bundle / SidebarBundle / Resources / public / js / widget-container / icon-view.js View on Github external
onClick: function (e) {
            e.stopPropagation();
            e.preventDefault();

            if (this.model.isDragged) {
                return;
            }

            var cord = this.$el.offset();

            Backbone.trigger('showWidgetHover', this.model.cid, cord);
        }
    });
github rombdn / barotweet / public / js / models / map.js View on Github external
var placeProfileLink = $('<a data-place-id="' + place._id + '" class="map-popup-link" href="#">' + place.name + '</a>').click(function(e){
								Backbone.trigger('map:popup-click', $(e.target).data('placeId'));
							})[0];
github orizens / echoes / src / BACKBONE / libs / backbone / backbone.switcher.js View on Github external
var init = function() {
	Backbone.trigger('extend:View', {
		key: 'switcher',
		extension: Switcher,
		initialize: function () {
			this.trigger('after:initialize');
		}
	});
};
github berekuk / questhub / www / src / views / navbar.jsx View on Github external
          <a href="#"> Backbone.trigger('pp:logout')}&gt;
            Logout</a>
github categolj / categolj2-backend / backend-ui / app / js / models / Entry.js View on Github external
getFormattedContents: function () {
            var body = this.get('contents');
            if (body) {
                switch (this.get('format')) {
                    case 'md':
                    {
                        body = marked(this.get('contents'));
                        break;
                    }
                    case 'rst':
                    {
                        Backbone.trigger('exception', {
                            message: '"rst" is not supported yet!'
                        });
                        break;
                    }
                }
            }
            return body;
        },
        appendContents: function (append) {
github berekuk / questhub / www / src / views / navbar.jsx View on Github external
            <a href="#"> Backbone.trigger('pp:login-with-persona')}&gt;
              with Email</a>
github oroinc / platform / src / Oro / Bundle / SidebarBundle / Resources / public / js / widget-container / view.js View on Github external
onClickSettings: function(e) {
            e.stopPropagation();
            e.preventDefault();

            Backbone.trigger('setupWidget', this.model.cid);
        },