mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-04 08:03:37 +01:00
Merge pull request #1223 from wknet123/dev-fix-popup
Fixed popup and inline help toggle issues. NMT
This commit is contained in:
commit
fde7b87665
@ -188,14 +188,13 @@
|
|||||||
return directive;
|
return directive;
|
||||||
|
|
||||||
function link(scope, element, attrs, ctrl) {
|
function link(scope, element, attrs, ctrl) {
|
||||||
|
|
||||||
$(document).on('click', clickHandler);
|
$(document).on('click', clickHandler);
|
||||||
|
|
||||||
function clickHandler(e) {
|
function clickHandler(e) {
|
||||||
$('[data-toggle="popover"]').each(function () {
|
$('[data-toggle="popover"],[data-original-title]').each(function () {
|
||||||
if (!$(this).is(e.target) &&
|
if (!$(this).is(e.target) && $(this).has(e.target).length === 0 && $('.popover').has(e.target).length === 0) {
|
||||||
$(this).has(e.target).length === 0 &&
|
(($(this).popover('hide').data('bs.popover')||{}).inState||{}).click = false;
|
||||||
$('.popover').has(e.target).length === 0) {
|
|
||||||
$(this).parent().popover('hide');
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
var targetId = $(e.target).attr('id');
|
var targetId = $(e.target).attr('id');
|
||||||
|
@ -1,17 +1,3 @@
|
|||||||
<!--
|
<a href="javascript:void(0);" role="button" tabindex="0" data-trigger="focus" data-toggle="popover" data-placement="right">
|
||||||
Copyright (c) 2016 VMware, Inc. All Rights Reserved.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
-->
|
|
||||||
<a role="button" tab-index="0" data-trigger="focus" data-toggle="popover" data-placement="right" data-title="//vm.helpTitle//">
|
|
||||||
<span class="glyphicon glyphicon-info-sign"></span>
|
<span class="glyphicon glyphicon-info-sign"></span>
|
||||||
</a>
|
</a>
|
@ -29,6 +29,7 @@
|
|||||||
'helpTitle': '@',
|
'helpTitle': '@',
|
||||||
'content': '@'
|
'content': '@'
|
||||||
},
|
},
|
||||||
|
'replace': true,
|
||||||
'link': link,
|
'link': link,
|
||||||
'controller': InlineHelpController,
|
'controller': InlineHelpController,
|
||||||
'controllerAs': 'vm',
|
'controllerAs': 'vm',
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
<a href="javascript:void(0)">
|
<a href="javascript:void(0);" role="button" tabindex="0" data-trigger="click" data-toggle="popover" data-placement="right">
|
||||||
<span class="glyphicon glyphicon-info-sign" role="button" data-trigger="click" data-toggle="popover" data-placement="right">
|
<span class="glyphicon glyphicon-info-sign"></span>
|
||||||
</span>
|
|
||||||
</a>
|
</a>
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
popupDetails.$inject = ['ListManifestService', '$filter', 'dateLFilter'];
|
popupDetails.$inject = ['ListManifestService', '$filter', 'dateLFilter'];
|
||||||
|
|
||||||
function popupDetails(ListManifestService, $filter, dateLFilter) {
|
function popupDetails(ListManifestService, $filter, dateLFilter) {
|
||||||
var directive = {
|
var directive = {
|
||||||
'restrict': 'E',
|
'restrict': 'E',
|
||||||
@ -46,6 +46,7 @@
|
|||||||
return directive;
|
return directive;
|
||||||
|
|
||||||
function link(scope, element, attrs, ctrl) {
|
function link(scope, element, attrs, ctrl) {
|
||||||
|
|
||||||
element
|
element
|
||||||
.popover({
|
.popover({
|
||||||
'template': '<div class="popover" role="tooltip"><div class="arrow"></div><div class="popover-title"></div><div class="popover-content"></div></div>',
|
'template': '<div class="popover" role="tooltip"><div class="arrow"></div><div class="popover-title"></div><div class="popover-content"></div></div>',
|
||||||
@ -68,16 +69,16 @@
|
|||||||
ctrl.manifest['created'] = $filter('dateL')(ctrl.manifest['created'], 'YYYY-MM-DD HH:mm:ss');
|
ctrl.manifest['created'] = $filter('dateL')(ctrl.manifest['created'], 'YYYY-MM-DD HH:mm:ss');
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.on('inserted.bs.popover', function(e){
|
.on('inserted.bs.popover', function(e){
|
||||||
var self = jQuery(this);
|
var self = jQuery(this);
|
||||||
$('[type="text"]:input', self.parent())
|
$('[type="text"]:input', self.parent())
|
||||||
.on('click', function() {
|
.on('click', function(e) {
|
||||||
$(this).select();
|
$(this).select();
|
||||||
});
|
});
|
||||||
self.parent().find('.glyphicon.glyphicon-remove-circle').on('click', function() {
|
self.parent().find('.glyphicon.glyphicon-remove-circle').on('click', function() {
|
||||||
element.trigger('click');
|
self.trigger('click');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function generateContent() {
|
function generateContent() {
|
||||||
var content = '<form class="form-horizontal" width="100%">' +
|
var content = '<form class="form-horizontal" width="100%">' +
|
||||||
|
Loading…
Reference in New Issue
Block a user