-
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.
Revert "Merge pull request #1876 from w33ble/clipboard"
- Loading branch information
Spencer Alger
committed
Nov 11, 2014
1 parent
34466c6
commit ff1f3da
Showing
7 changed files
with
77 additions
and
120 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 |
---|---|---|
@@ -1,49 +1,41 @@ | ||
define(function (require) { | ||
// ng-clip expects ZeroClipboard to be global, but it's AMD, so it never is | ||
var ZeroClipboard = window.ZeroClipboard = require('zeroclipboard'); | ||
require('ng-clip'); | ||
|
||
var $ = require('jquery'); | ||
var html = require('text!components/clipboard/clipboard.html'); | ||
var module = require('modules').get('kibana'); | ||
|
||
module.directive('kbnClipboard', function ($compile, $timeout) { | ||
return { | ||
restrict: 'E', | ||
template: html, | ||
replace: true, | ||
scope: { | ||
copyText: '=copy' | ||
}, | ||
transclude: true, | ||
link: function ($scope, $el, attr) { | ||
if (ZeroClipboard.isFlashUnusable()) { | ||
$scope.disabled = true; | ||
return; | ||
} | ||
|
||
$scope.tipPlacement = attr.tipPlacement || 'top'; | ||
$scope.tipText = attr.tipText || 'Copy to clipboard'; | ||
$scope.tipConfirm = attr.tipConfirm = 'Copied!'; | ||
$scope.icon = attr.icon || 'fa-clipboard'; | ||
require('modules') | ||
.get('kibana') | ||
.directive('kbnClipboard', function ($compile, $timeout) { | ||
return { | ||
restrict: 'E', | ||
template: html, | ||
replace: true, | ||
scope: { | ||
copyText: '=copy' | ||
}, | ||
transclude: true, | ||
link: function ($scope, $el, attr) { | ||
$scope.tipPlacement = attr.tipPlacement || 'top'; | ||
$scope.tipText = attr.tipText || 'Copy to clipboard'; | ||
$scope.tipConfirm = attr.tipConfirm = 'Copied!'; | ||
$scope.icon = attr.icon || 'fa-clipboard'; | ||
|
||
$scope.shownText = $scope.tipText; | ||
$scope.shownText = $scope.tipText; | ||
|
||
$el.on('click', function () { | ||
$scope.shownText = $scope.tipConfirm; | ||
// Reposition tooltip to account for text length change | ||
$('a', $el).mouseenter(); | ||
}); | ||
$el.on('click', function () { | ||
$scope.shownText = $scope.tipConfirm; | ||
// Reposition tooltip to account for text length change | ||
$('a', $el).mouseenter(); | ||
}); | ||
|
||
$el.on('mouseleave', function () { | ||
$scope.shownText = $scope.tipText; | ||
}); | ||
$el.on('mouseleave', function () { | ||
$scope.shownText = $scope.tipText; | ||
}); | ||
|
||
$scope.$on('$destroy', function () { | ||
$el.off('click'); | ||
$el.off('mouseleave'); | ||
}); | ||
} | ||
}; | ||
}); | ||
$scope.$on('$destroy', function () { | ||
$el.off('click'); | ||
$el.off('mouseleave'); | ||
}); | ||
} | ||
}; | ||
}); | ||
}); |
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
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 |
---|---|---|
|
@@ -61,6 +61,7 @@ require.config({ | |
leaflet: { | ||
deps: ['css!bower_components/leaflet/dist/leaflet.css'] | ||
} | ||
|
||
}, | ||
waitSeconds: 60 | ||
}); |
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