experimenting with new func editor

This commit is contained in:
Torkel Ödegaard 2014-03-05 12:46:27 +01:00
parent bd0f694f6a
commit e186c9b8bc
5 changed files with 39 additions and 5 deletions

View File

@ -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';
});
}
};
});
}); });

View File

@ -76,9 +76,19 @@
</ul> </ul>
</li> </li>
<li ng-repeat="func in functions"> <li ng-repeat="func in functions">
<a class="grafana-target-segment grafana-target-function dropdown-toggle" bs-popover="'app/partials/graphite/funcEditor.html'" data-placement="bottom"> <!-- <a class="grafana-target-segment grafana-target-function dropdown-toggle"
{{func.text}} bs-popover="'app/partials/graphite/funcEditor.html'"
</a> data-placement="bottom">
{{func.def.name}}
</a> -->
<span class="grafana-target-segment grafana-target-function">
<span>{{func.def.name}}(</span><span ng-repeat="param in func.def.params">
<input type="text"
class="input-mini grafana-function-param-input"
dynamic-width
ng-model="func.params[$index]"></input>
</span><span>)</span>
</span>
</li> </li>
<li class="dropdown" graphite-add-func> <li class="dropdown" graphite-add-func>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -281,6 +281,13 @@
} }
} }
input[type=text].grafana-function-param-input {
background: transparent;
border: none;
margin: 0;
padding: 0;
}
.grafana-target-controls-left { .grafana-target-controls-left {
list-style: none; list-style: none;
float: left; float: left;