From 4002c4ee056754959e4eecb5c4cc86a1698b8007 Mon Sep 17 00:00:00 2001 From: Codenift Date: Wed, 11 Mar 2020 21:05:47 -0400 Subject: [PATCH] Tooltip for track type column in track library --- airtime_mvc/public/css/media_library.css | 34 +++++++++++++++++ .../public/js/airtime/library/library.js | 37 +++++++++++++++++++ 2 files changed, 71 insertions(+) diff --git a/airtime_mvc/public/css/media_library.css b/airtime_mvc/public/css/media_library.css index 875b7e993..9d9e44d7e 100644 --- a/airtime_mvc/public/css/media_library.css +++ b/airtime_mvc/public/css/media_library.css @@ -142,6 +142,40 @@ tr.lib-selected > td > div.library_actions_btn:hover { color: #eee; } +td.library_track_type +{ + padding: 0px !important; +} + +.library_track_type_btn { + float: left; + font-weight: bold; + white-space: nowrap; + border: 1px solid #ccc; + border-radius: 2px; + padding: 0px !important; + margin: 0px !important; + margin-right: 6px !important; + line-height: 17px !important; + padding: 3px !important; +} + +.library_track_type_btn:hover { + background: #555; +} +tr.lib-selected > td > div.library_track_type_btn { + border-color: #000; +} +tr.lib-selected > td > div.library_track_type_btn:hover { + background: #000; + color: #eee; +} +.track-type-tip{ + margin-left: -50px; + margin-top: -68px; + z-index: 1000 !important; +} + .library_import { padding-bottom: 5px; } diff --git a/airtime_mvc/public/js/airtime/library/library.js b/airtime_mvc/public/js/airtime/library/library.js index 52a4e402f..81e500628 100644 --- a/airtime_mvc/public/js/airtime/library/library.js +++ b/airtime_mvc/public/js/airtime/library/library.js @@ -766,6 +766,43 @@ var AIRTIME = (function(AIRTIME) { .on('click', function (e) { $(this).contextMenu({x: $(e.target).offset().left, y: $(e.target).offset().top}) }).html("
...
"); + + $(nRow).find('td.library_track_type') + .on('click', function (e) { + + $.getJSON( + baseUrl + "api/track-types", + function(json){ + var type_enabled = false; + $.each(json, function(key, value) { + + if(value['code'] == aData.track_type){ + $("#au_"+aData.id+" td.library_track_type div.library_track_type_btn").qtip({ + content: { + text: value['type_name'] + }, + style: { + classes: 'track-type-tip' + }, + show: { + ready: true + }, + hide: { + distance: 30, + fixed: true, + } + }); + + type_enabled = true; + } + }); + + if(type_enabled == false){ + alert("This type is disabled."); + } + }); + + }).html("
"+aData.track_type+"
"); } // add audio preview image/button