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
42 lines (32 loc) • 1.54 kB
JavaScript
/* Il prefisso "component_" negli attributi del modello serve ad evitare collisioni
(sia l'app che il panel usano Backbone) */
define(["backbone", "underscore", "models/AppComponent", "backboneAgentClient"],
function(Backbone, _, AppComponent, backboneAgentClient) {
var AppView = AppComponent.extend({
category: "View",
// see backbone agent for supported attributes
// print the view el on the console
printElement: function() {
backboneAgentClient.execFunction(function(componentIndex) {
var appViewInfo = this.appComponentsInfos['View'].at(componentIndex);
var appViewEl = appViewInfo.component.el;
console.log(appViewEl);
}, [this.index]);
},
inspectElement: function() {
backboneAgentClient.execFunction(function(componentIndex) {
var appViewInfo = this.appComponentsInfos['View'].at(componentIndex);
var appView = appViewInfo.component;
var element = appView.$el ? appView.$el[0] : appView.el;
inspect(element);
}, [this.index]);
},
highlightElement: function() {
backboneAgentClient.execFunction(function(componentIndex) {
var appViewInfo = this.appComponentsInfos['View'].at(componentIndex);
this.appComponentControllers['View'].highlightViewElement(appViewInfo.component);
}, [this.index]);
}
});
return AppView;
});