Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add View Info Panel #33

Open
jasonLaster opened this issue Jan 23, 2015 · 2 comments
Open

Add View Info Panel #33

jasonLaster opened this issue Jan 23, 2015 · 2 comments

Comments

@jasonLaster
Copy link

The Marionette Inspector provides tons of metadata about view properties in the info panel.

Some properties that the inspector has which could easily be added to the debugger are:

  • events (dom events)
  • listeners (bb _events)
  • ui (subset of view properties that are dom properties)
  • class properties (view properties organized by prototype chain class properties, parent class, ..., BB.View properteis)

Info Panel

Inspector serialize function

serializeView.js

this.serializeView = function(view) {
  var data = {};
  // debug.log('serializeView', view)

  if (!_.isObject(view)) {
    return {};
  }


  data.cid = view.cid;
  data.isLoading = false; // set when a view is registered, but not serialized

  data.options = this.serializeObject(view.options);
  data.el = this.serializeElement(view.el, 'el', false);
  data.events = serializeEventsHash(view.events);
  data._events = this.serializeEvents(view._events);
  data.properties = this.serializeObjectProperties(view);
  data.ancestorInfo = this.ancestorInfo(view);
  data._requirePath = view._requirePath;
  data._className = this.serializeClassName(view);
  data.parentClass = this.isKnownType(view) ? this.knownType(view).name : '';
  data.inspect = this.inspectValue(view);

  if (view.model) {
    data.model = {
      cid: view.model.cid
    };
  }

  return data;
}
@jridgewell
Copy link

An interesting side effect of jashkenas/backbone#3455 is it should be pretty easy to extend any logic for "on events" (Backbone.Events) to any "listenTo events" as well.

@Maluen
Copy link
Owner

Maluen commented Jan 23, 2015

Great suggestions! For this and for adding (showing) new features we definitely need a general / scalable UI, I've opened an issue: #34

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants