'libs/jquery-1.9.1.min',
'libs/underscore-min',
'modules/documentCanvas/classAttributes',
-'modules/documentCanvas/canvas/utils'
-], function($, _, classAttributes, utils) {
+'modules/documentCanvas/canvas/utils',
+'modules/documentCanvas/canvas/widgets'
+], function($, _, classAttributes, utils, widgets) {
'use strict';
dom.css('display', displayStyle);
container.css('display', displayStyle);
- var widgets = $('<div class="canvas-widgets" contenteditable="false">');
- widgets.append($('<span class="canvas-widget canvas-widget-label">').text(params.tag + (params.klass ? ' / ' + params.klass : '')));
- dom.append(widgets);
+ var widgetsContainer = $('<div class="canvas-widgets" contenteditable="false">');
+ widgetsContainer.append(widgets.labelWidget(params.tag, params.klass));
+ dom.append(widgetsContainer);
// Make sure widgets aren't navigable with arrow keys
- widgets.find('*').add(widgets).attr('tabindex', -1);
+ widgetsContainer.find('*').add(widgetsContainer).attr('tabindex', -1);
dom.append(container);
--- /dev/null
+define([
+'libs/jquery-1.9.1.min'
+], function($) {
+
+'use strict';
+
+return {
+ labelWidget: function(tag, klass) {
+ return $('<span>')
+ .addClass('canvas-widget canvas-widget-label')
+ .text(tag + (klass ? ' / ' + klass : ''));
+ }
+};
+
+});
\ No newline at end of file
@import 'nodes.less';
+@import 'canvas/widgets.less';
#rng-module-documentCanvas {
height: 100%;
.highlighted-element {
border: 1px solid red;
}
-
-
- .canvas-widgets {
- display: inline;
- }
-
- .canvas-widget {
- display: none;
- }
-
- .canvas-widget-label {
- position: absolute;
- display: none;
- top: -20px;
- left:0;
- background-color: red;
- color: white;
- font-size:12px;
- font-weight: bold;
- padding: 1px 3px;
- //width:300px;
- opacity: 0.65;
- font-family: monospace;
- z-index:9999;
- white-space: nowrap;
- }
}
.rng-module-documentCanvas-currentNode {