diff options
author | slene <vslene@gmail.com> | 2014-03-17 18:13:07 +0800 |
---|---|---|
committer | slene <vslene@gmail.com> | 2014-03-17 18:13:07 +0800 |
commit | 26f9962b6e0089773615ca34ab80ca01ede79790 (patch) | |
tree | 80a02f6ccd8bdf418dae3b5fea90269d59f3a84a /public/js | |
parent | df1985e1e8ff8a5173b3a80a6bcdaee13f6a0b1a (diff) | |
download | gitea-26f9962b6e0089773615ca34ab80ca01ede79790.tar.gz gitea-26f9962b6e0089773615ca34ab80ca01ede79790.zip |
clone in ssh
Diffstat (limited to 'public/js')
-rw-r--r-- | public/js/app.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/public/js/app.js b/public/js/app.js index 58633718fc..30296bc337 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -40,6 +40,25 @@ var Gogits = { //container: "body" }); }; + Gogits.initPopovers = function () { + var hideAllPopovers = function() { + $('[data-toggle=popover]').each(function() { + $(this).popover('hide'); + }); + }; + + $(document).on('click', function(e) { + var $e = $(e.target); + if($e.data('toggle') == 'popover'||$e.parents("[data-toggle=popover], .popover").length > 0){ + return; + } + hideAllPopovers(); + }); + + $("body").popover({ + selector: "[data-toggle=popover]" + }); + }; Gogits.initTabs = function () { var $tabs = $('[data-init=tabs]'); $tabs.find("li:eq(0) a").tab("show"); @@ -76,6 +95,7 @@ var Gogits = { function initCore() { Gogits.initTooltips(); + Gogits.initPopovers(); Gogits.initTabs(); Gogits.initModals(); Gogits.renderMarkdown(); |