UNPKG

electron-devtools-vendor

Version:

<div align="center"> <h2>electron-devtools-vendor</h2> <img alt="MIT" src="https://img.shields.io/github/license/BlackHole1/electron-devtools-vendor?color=9cf&style=flat-square"> <img alt="GitHub repo size" src="https://img.shields.io/github/r

48 lines (35 loc) 1.34 kB
/* View activated while waiting for the inspected page loading. */ define(["backbone", "underscore", "jquery", "views/View", "templates/waiting"], function(Backbone, _, $, View, template) { var WaitingView = View.extend({ template: template, // the waiting text to display waitingPhase: undefined, initialize: function(options) { View.prototype.initialize.apply(this, arguments); options = options || {}; this.render(); }, inspectedPagePhase: function() { return this.setWaitingPhase('inspectedPage'); }, backbonePhase: function() { return this.setWaitingPhase('backbone'); }, setWaitingPhase: function(waitingPhase) { this.waitingPhase = waitingPhase; this.render(); }, templateData: function() { return { inspectedPagePhase: this.waitingPhase === 'inspectedPage', backbonePhase: this.waitingPhase === 'backbone' }; }, render: function() { this.el.innerHTML = this.template(this.templateData()); // DON'T use this.$el.html() because it removes the jQuery event handlers of existing sub-views return this; } }); return WaitingView; });