From 5b1a3170acd482ded223cc21f31fcbf62964f4d4 Mon Sep 17 00:00:00 2001 From: Douglas Duteil Date: Wed, 14 Jan 2015 22:44:22 +0100 Subject: [PATCH] fix: onLoad called in the middle of the options Call the onLoad call back at the end of the options process. Close #93 --- src/ui-ace.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ui-ace.js b/src/ui-ace.js index 7b8eb2c..36acb87 100644 --- a/src/ui-ace.js +++ b/src/ui-ace.js @@ -79,13 +79,6 @@ angular.module('ui.ace', []) ]); } - // onLoad callbacks - angular.forEach(opts.callbacks, function (cb) { - if (angular.isFunction(cb)) { - cb(acee); - } - }); - // Basic options if (angular.isString(opts.theme)) { acee.setTheme('ace/theme/' + opts.theme); @@ -122,6 +115,13 @@ angular.module('ui.ace', []) acee.renderer.setOption(obj.name, obj.value); } } + + // onLoad callbacks + angular.forEach(opts.callbacks, function (cb) { + if (angular.isFunction(cb)) { + cb(acee); + } + }); }; return {