node.addClass('rng-current');\r
mediator.nodeSelected(node);\r
},\r
+ markFirstSelected: function() {\r
+ var firstNodeWithText = this.node.find('[wlxml-tag]').filter(function() {\r
+ return $(this).clone().children().remove().end().text().trim() !== '';\r
+ }).first();\r
+ if(firstNodeWithText.length)\r
+ $(firstNodeWithText[0]).click().focus();\r
+ },\r
_addMetaRow: function(key, value) {\r
var newRow = $(sandbox.getTemplate('metaItem')({key: key || '', value: value || ''}));\r
newRow.appendTo(this.metaTable);\r
}\r
\r
var isDirty = false;\r
- \r
+ var wasShownAlready = false;\r
\r
\r
return {\r
},\r
setDirty: function(dirty) {\r
isDirty = dirty;\r
+ },\r
+ onShowed: function() {\r
+ if(!wasShownAlready) {\r
+ wasShownAlready = true;\r
+ view.markFirstSelected();\r
+ }\r
}\r
\r
}\r