From e186c9b8bc6305f2f16655b69e71a56a28009dbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Wed, 5 Mar 2014 12:46:27 +0100 Subject: [PATCH] experimenting with new func editor --- src/app/directives/ngBlur.js | 17 +++++++++++++++++ src/app/partials/graphite/editor.html | 16 +++++++++++++--- src/css/bootstrap.dark.min.css | 2 +- src/css/bootstrap.light.min.css | 2 +- src/css/less/grafana.less | 7 +++++++ 5 files changed, 39 insertions(+), 5 deletions(-) diff --git a/src/app/directives/ngBlur.js b/src/app/directives/ngBlur.js index 663d33f9eff..f8b2dd01b8a 100644 --- a/src/app/directives/ngBlur.js +++ b/src/app/directives/ngBlur.js @@ -17,4 +17,21 @@ function (angular) { }; }]); + angular + .module('kibana.directives') + .directive('dynamicWidth', function() { + return { + restrict: 'A', + link: function postLink(scope, elem, attrs) { + var startVal = scope.$eval(attrs.ngModel); + elem[0].style.width = ((startVal.length) * 11) + 'px'; + + elem.keyup(function() { + elem[0].style.width = ((elem.val().length * 11)) + 'px'; + }); + } + }; + }); + + }); \ No newline at end of file diff --git a/src/app/partials/graphite/editor.html b/src/app/partials/graphite/editor.html index 65cfe883181..92f513f8154 100644 --- a/src/app/partials/graphite/editor.html +++ b/src/app/partials/graphite/editor.html @@ -76,9 +76,19 @@
  • - - {{func.text}} - + + + {{func.def.name}}( + + ) +