-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add drag to resize panel widths. Closes #329
- Loading branch information
Rashid Khan
committed
Apr 24, 2014
1 parent
34a3590
commit 50ba841
Showing
6 changed files
with
52 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
define([ | ||
'angular', | ||
], | ||
function (angular) { | ||
'use strict'; | ||
|
||
angular | ||
.module('kibana.directives') | ||
.directive('resizable', function() { | ||
return { | ||
restrict: 'A', | ||
link: function(scope, elem) { | ||
console.log('linked'); | ||
|
||
var getOpts = function() { | ||
return { | ||
maxWidth: elem.parent().width(), | ||
grid: elem.parent().width()/12 | ||
}; | ||
}; | ||
|
||
// 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; | ||
scope.$apply(); | ||
}); | ||
} | ||
}; | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters