diff --git a/bower.json b/bower.json index 5fd9a3e..4789b49 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "angular-json-editor", - "version": "0.3.0", + "version": "0.3.1", "authors": [ "Rodik Hanukaev ", "Topaz Bar " diff --git a/dist/angular-json-editor.min.js b/dist/angular-json-editor.min.js index f07c361..76fec8f 100644 --- a/dist/angular-json-editor.min.js +++ b/dist/angular-json-editor.min.js @@ -1,2 +1,2 @@ -// angular-json-editor v0.3.0 +// angular-json-editor v0.3.1 !function(a,b){"use strict";b.module("angular-json-editor",[]).provider("JSONEditor",function(){function a(c){return b.forEach(arguments,function(d){d!==c&&b.forEach(d,function(b,d){c[d]&&c[d].constructor&&c[d].constructor===Object?a(c[d],b):c[d]=b})}),c}var c={defaults:{options:{iconlib:"bootstrap3",theme:"bootstrap3"}}};this.configure=function(b){a(c,b)},this.$get=["$window",function(b){return a(b.JSONEditor,c),b.JSONEditor}]}).directive("jsonEditor",["$q","JSONEditor",function(a,c){return{restrict:"E",transclude:!0,scope:{schema:"=",startval:"=",buttonsController:"@",onChange:"&"},controller:["$scope","$attrs","$controller",function(a,c,d){var e,f,g=c.buttonsController;if(b.isString(g)&&""!==g){f={$scope:a};try{e=d(g,f)}catch(a){throw new Error("angular-json-editor: buttons-controller attribute must be a valid controller.")}}}],link:function(d,e,f,g,h){var i=a.when(d.startval),j=a.when(d.schema);if(d.isValid=!1,!b.isString(f.schema))throw new Error("angular-json-editor: schema attribute has to be defined.");a.all([j,i]).then(function(b){function f(){var a=k;d.editor&&d.editor.destroy&&(a=d.editor.getValue(),d.editor.destroy()),d.editor=new c(e[0],{startval:a,schema:j},!0),d.editor.on("ready",g),d.editor.on("change",i),e.append(l)}function g(){d.isValid=0===d.editor.validate().length}function i(){"function"==typeof d.onChange&&d.onChange({$editorValue:d.editor.getValue()}),d.$apply(function(){d.isValid=0===d.editor.validate().length})}var j=b[0].data||b[0],k=b[1].data||b[1];if(null===j)throw new Error("angular-json-editor: could not resolve schema data.");f(),d.$watch("schema",function(a){a.then?a.then(function(a){j=a,f()}):(j=a,f())},!0),d.$watchCollection("schema",function(b){b instanceof a&&b.then(function(a){j=a.data?a.data:a,f()})});var l=h(d,function(a){return a});h(d,function(a){e.append(a)})})}}}])}(window,angular); \ No newline at end of file diff --git a/package.json b/package.json index c4de244..66e93da 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "angular-json-editor", - "version": "0.3.0", + "version": "0.3.1", "repository": { "type": "git", "url": "git://github.com/rodikh/angular-json-editor.git"