X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/f07cd8d76ad2bc0fbfada50ad35bad4f4b307267..efe36f4f1b5df351eeb4d40a54c3900cf9a7079b:/modules/nodePane/metaWidget/metaWidget.js?ds=inline diff --git a/modules/nodePane/metaWidget/metaWidget.js b/modules/nodePane/metaWidget/metaWidget.js deleted file mode 100644 index 569153d..0000000 --- a/modules/nodePane/metaWidget/metaWidget.js +++ /dev/null @@ -1,43 +0,0 @@ -define([ -'libs/jquery-1.9.1.min', -'libs/underscore-min', -'libs/backbone-min', -'libs/text!./stringField.html' -], function($, _, Backbone, stringFieldTpl) { - -'use strict'; - -var templates = { - string: _.template(stringFieldTpl) -} - -var getAttrElement = function(attr) { - var toret = $('
'); - toret.append(templates.string({name: attr.name, value: attr.value})); - return toret; -} - -var MetaWidget = Backbone.View.extend({ - events: { - 'change [metaField-name]': 'onMetaFieldChange' - }, - initialize: function() { - var view = this; - this.options.attrs.forEach(function(attr) { - view.$el.append(getAttrElement(attr)); - }) - }, - onMetaFieldChange: function(e) { - var target = $(e.target); - this.trigger('valueChanged', target.attr('metaField-name'), target.val()); - } -}); - - -return { - create: function(options) { - return new MetaWidget(options); - } -} - -}); \ No newline at end of file