mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 00:20:25 +08: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:
		@@ -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