Sha256: d7b510b6593b1ab8103f85a66c93d8db68ec37d28c3ab8f6ff27522b8c6a7fb4

Contents?: true

Size: 824 Bytes

Versions: 5

Compression:

Stored size: 824 Bytes

Contents

define([
  'angular',
],
function (angular) {
  'use strict';

  angular
    .module('kibana.directives')
    .directive('resizable', function() {
      return {
        restrict: 'A',
        link: function(scope, elem) {

          var getOpts = function() {
            return {
              maxWidth: elem.parent().width(),
              grid: elem.parent().width()/12,
              handles: 'e'
            };
          };

          // Re-render if the window is resized
          angular.element(window).bind('resize', function(){
            elem.resizable(getOpts());
          });

          elem.resizable(getOpts());
          elem.resize(function (event, ui) {
            scope.panel.span = Math.round(((ui.size.width / elem.parent().width()) * 100) * 1.2 / 10);
          });
        }
      };
    });
});

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
kibana-sinatra-3.1.2.0 lib/kibana/assets/app/directives/resizable.js
kibana-sinatra-3.1.1.0 lib/kibana/assets/app/directives/resizable.js
kibana-sinatra-3.1.0.2 lib/kibana/assets/app/directives/resizable.js
kibana-sinatra-3.1.0.1 lib/kibana/assets/app/directives/resizable.js
kibana-sinatra-3.1.0.0 lib/kibana/assets/app/directives/resizable.js