- children: function() {
- var element = this,
- toret = [];
- this._container().contents().each(function() {
- var childElement = element.canvas.getDocumentElement(this);
- if(childElement === undefined) {
- return true;
- }
-
- toret.push(childElement);
- });
- return toret;
- },
-
- getFirst: function(e1, e2) {
- var idx1 = this.childIndex(e1),
- idx2 = this.childIndex(e2);
- if(e1 === null || e2 === null) {
- return undefined;
- }
- return idx1 <= idx2 ? e1: e2;
- },
-
- childIndex: function(child) {
- var children = this.children(),
- toret = null;
- children.forEach(function(c, idx) {
- if(c.sameNode(child)) {
- toret = idx;
- return false;
- }
- });
- return toret;
- },
-
- getWlxmlClass: function() {
- var klass = this._container().attr('wlxml-class');
- if(klass) {
- return klass.replace(/-/g, '.');
+ onStateChange: function(changes) {
+ if(_.isBoolean(changes.exposed) && !this.isSpan()) {
+ this._container().toggleClass('highlighted-element', changes.exposed);