Skip to content

Commit

Permalink
changing the now playing tagger to a slide out
Browse files Browse the repository at this point in the history
  • Loading branch information
John Moore committed Nov 20, 2013
1 parent f4d7b64 commit 4f6efeb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
9 changes: 7 additions & 2 deletions lib/javascript/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,11 @@ function check_inline_song_edit(type, song) {
}

function showAddTagSlideout(elm) {
$(elm).show(500, 'slide');
$(elm).show('slide', 500);
}

function closeAddTagSlideout(elm) {
$(elm).hide('slide', 500);
}

function saveTag(id, type, path) {
Expand All @@ -97,7 +101,8 @@ function saveTag(id, type, path) {
ajaxPut(path + '/server/ajax.server.php?page=tag&action=add_tag_by_name&type=' + type + '&object_id=' + id + '&tag_name=' + tagName);
}
$('#dialog_tag_item_tag_name').val('');
$(this).parent().hide(500, 'slide');
$('#dialog_tag_item_' + id).hide('slide', 500);
$('#np_song_tags_' + id).append('<a href="javascript:void(0);" class="hover-remove tag_size2">' + tagName + '</a>')
}

function showAddTagDialog(id, type, path) {
Expand Down
11 changes: 7 additions & 4 deletions templates/show_now_playing_row.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,18 @@
<?php echo $media->f_artist_link; ?>
</div>

<div class="np_cell cel_artist">
<div id="np_song_tags_<?php echo $media->id?>" class="np_cell cel_artist">
<label><?php echo T_('Tags'); ?></label>

<a href="#" id="tag_song_<?php echo $media->id?>" onclick="showAddTagSlideout('#dialog_tag_item_<?php echo $media->id?>')"><?php echo UI::get_icon('add', T_('Add')); ?></a><?php echo $media->f_tags; ?>
<a href="#" id="tag_song_<?php echo $media->id?>" onclick="showAddTagSlideout('#dialog_tag_item_<?php echo $media->id?>')"><?php echo UI::get_icon('add', T_('Add')); ?></a>
<?php echo $media->f_tags; ?>
</div>
<div id="dialog_tag_item_<?php echo $media->id?>" style="display:none;" class="np_cell cel_artist">
<span><?php echo T_('Enter tag:')?></span>
<input type="text" id="dialog_tag_item_tag_name_<?php echo $media->id?>"/>
<input type="button" value="<?php echo _T('Save')?>" onclick="saveTag(<?php echo $media->id?>, 'song', '<?php echo Config::get('web_path'); ?>')" />
<span>
<input type="button" value="<?php echo T_('Save')?>" onclick="saveTag(<?php echo $media->id?>, 'song', '<?php echo Config::get('web_path'); ?>')" />
<input type="button" value="<?php echo T_('Close')?>" onclick="closeAddTagSlideout('#dialog_tag_item_<?php echo $media->id?>')" />
</span>
</div>
</div>

Expand Down

0 comments on commit 4f6efeb

Please sign in to comment.