1 define(function(require) {
6 var $ = require('libs/jquery'),
7 _ = require('libs/underscore'),
8 documentElement = require('modules/documentCanvas/canvas/documentElement'),
9 viewTemplate = require('libs/text!./view.html');
11 var OrderExerciceElement = Object.create(documentElement.DocumentNodeElement.prototype);
12 _.extend(OrderExerciceElement, {
14 documentElement.DocumentNodeElement.prototype.init.call(this);
15 var view = $(_.template(viewTemplate)());
16 this._container().append(view);
18 this.createContainer(this.wlxmlNode.contents(), {
22 dom: view.find('.content')
25 this.addToContextMenu('core.createGap');
26 this.contextMenuActions[0].on('actionExecuted', function(ret) {
27 if(ret instanceof this.wlxmlNode.document.Fragment && ret.isValid()) {
28 this.canvas.select(ret);
31 this.addToContextMenu('core.removeGap');
33 getVerticallyFirstTextElement: function() {
34 // doesnt container handle this?
36 this.containers.some(function(container) {
37 toret = container.getVerticallyFirstTextElement();
44 return {tag: 'div', klass: 'exercise.gap', prototype: OrderExerciceElement};