mirror of
				https://github.com/go-gitea/gitea
				synced 2025-10-31 11:28:24 +00:00 
			
		
		
		
	Cleanup and use global style on popups (#17674)
* Cleanup and use global style on popups - Fix typo 'poping' to 'popping' - Remove most inline 'data-variation' attributes - Initialize all popups with 'inverted tiny' variation * misc tweaks * rename to .tooltip, use jQuery Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
		| @@ -137,7 +137,7 @@ function initVueComponents() { | ||||
|  | ||||
|     mounted() { | ||||
|       this.changeReposFilter(this.reposFilter); | ||||
|       $(this.$el).find('.poping.up').popup(); | ||||
|       $(this.$el).find('.tooltip').popup(); | ||||
|       $(this.$el).find('.dropdown').dropdown(); | ||||
|       this.setCheckboxes(); | ||||
|       Vue.nextTick(() => { | ||||
|   | ||||
| @@ -62,9 +62,8 @@ export function initGlobalCommon() { | ||||
|   // Show exact time | ||||
|   $('.time-since').each(function () { | ||||
|     $(this) | ||||
|       .addClass('poping up') | ||||
|       .addClass('tooltip') | ||||
|       .attr('data-content', $(this).attr('title')) | ||||
|       .attr('data-variation', 'inverted tiny') | ||||
|       .attr('title', ''); | ||||
|   }); | ||||
|  | ||||
| @@ -88,7 +87,7 @@ export function initGlobalCommon() { | ||||
|   $('.jump.dropdown').dropdown({ | ||||
|     action: 'hide', | ||||
|     onShow() { | ||||
|       $('.poping.up').popup('hide'); | ||||
|       $('.tooltip').popup('hide'); | ||||
|     }, | ||||
|     fullTextSearch: 'exact' | ||||
|   }); | ||||
| @@ -104,8 +103,17 @@ export function initGlobalCommon() { | ||||
|   $('.ui.progress').progress({ | ||||
|     showActivity: false | ||||
|   }); | ||||
|   $('.poping.up').attr('data-variation', 'inverted tiny').popup(); | ||||
|   $('.top.menu .poping.up').popup({ | ||||
|  | ||||
|   // init popups | ||||
|   $('.tooltip').each((_, el) => { | ||||
|     const $el = $(el); | ||||
|     const attr = $el.attr('data-variation'); | ||||
|     const attrs = attr ? attr.split(' ') : []; | ||||
|     const variations = new Set([...attrs, 'inverted', 'tiny']); | ||||
|     $el.attr('data-variation', [...variations].join(' ')).popup(); | ||||
|   }); | ||||
|  | ||||
|   $('.top.menu .tooltip').popup({ | ||||
|     onShow() { | ||||
|       if ($('.top.menu .menu.transition').hasClass('visible')) { | ||||
|         return false; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user