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