move group-click initialization to groups.js and only react on elements with a data-gid attribute given

This commit is contained in:
Arthur Schiwon 2014-02-25 14:05:48 +01:00
parent 65aa20433c
commit faab6c095c
3 changed files with 12 additions and 11 deletions

View File

@ -120,6 +120,16 @@ $(document).ready( function () {
} }
) )
}); });
// click on group name
// FIXME: also triggered when clicking on "remove"
$('ul').on('click', 'li[data-gid]', function (event) {
var li = $(this);
var gid = $(li).attr('data-gid');
// Call function for handling delete/undo on Groups
GroupList.showGroup(gid);
});
// Implements Groupname editing. // Implements Groupname editing.
$('#app-navigation').on('click', 'img.rename', function (event) { $('#app-navigation').on('click', 'img.rename', function (event) {
event.stopPropagation(); event.stopPropagation();

View File

@ -503,15 +503,6 @@ $(document).ready(function () {
}); });
}); });
// click on group name
// FIXME: also triggered when clicking on "remove"
$('ul').on('click', 'li', function (event) {
var li = $(this);
var gid = $(li).attr('data-gid');
// Call function for handling delete/undo on Groups
GroupList.showGroup(gid);
});
$('#newuser').submit(function (event) { $('#newuser').submit(function (event) {
event.preventDefault(); event.preventDefault();
var username = $('#newusername').val(); var username = $('#newusername').val();

View File

@ -12,7 +12,7 @@
</form> </form>
</li> </li>
<!-- Everyone --> <!-- Everyone -->
<li> <li data-gid="">
<a href="#"> <a href="#">
<span> <span>
<?php p($l->t('Everyone')); ?> <?php p($l->t('Everyone')); ?>