diff options
author | Mario Vavti <mario@mariovavti.com> | 2017-11-07 12:20:11 +0100 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2017-11-07 12:20:11 +0100 |
commit | b5d4acf10a49980035f89d37440ae41a574df5a0 (patch) | |
tree | 8b1ee6b4c2f65d8dc4285e8925a5157773eefcbc /view/js | |
parent | 47fbdda40951be5109c739f63331e2bb95ebd64a (diff) | |
parent | 7b69dc574b1527fc0e16a0c2f91a726132987e2f (diff) | |
download | volse-hubzilla-b5d4acf10a49980035f89d37440ae41a574df5a0.tar.gz volse-hubzilla-b5d4acf10a49980035f89d37440ae41a574df5a0.tar.bz2 volse-hubzilla-b5d4acf10a49980035f89d37440ae41a574df5a0.zip |
Merge remote-tracking branch 'mike/master' into dev
Diffstat (limited to 'view/js')
-rw-r--r-- | view/js/main.js | 14 | ||||
-rw-r--r-- | view/js/mod_defperms.js | 32 |
2 files changed, 44 insertions, 2 deletions
diff --git a/view/js/main.js b/view/js/main.js index 882f50e8a..c3873d823 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -32,7 +32,12 @@ function handle_comment_form(e) { var fields_empty = true; if(form.find('.comment-edit-text').length) { - form.find('.comment-edit-text').addClass('expanded').removeAttr('placeholder'); + var commentElm = form.find('.comment-edit-text').attr('id'); + var submitElm = commentElm.replace(/text/,'submit'); + + $('#' + commentElm).addClass('expanded').removeAttr('placeholder'); + $('#' + commentElm).attr('tabindex','9'); + $('#' + submitElm).attr('tabindex','10'); form.find(':not(:visible)').show(); } @@ -43,7 +48,12 @@ function handle_comment_form(e) { fields_empty = false; }); if(fields_empty) { - form.find('.comment-edit-text').removeClass('expanded').attr('placeholder', aStr.comment); + var emptyCommentElm = form.find('.comment-edit-text').attr('id'); + var emptySubmitElm = commentElm.replace(/text/,'submit'); + + $('#' + emptyCommentElm).removeClass('expanded').attr('placeholder', aStr.comment); + $('#' + emptyCommentElm).removeAttr('tabindex'); + $('#' + emptySubmitElm).removeAttr('tabindex'); form.find(':not(.comment-edit-text)').hide(); } }); diff --git a/view/js/mod_defperms.js b/view/js/mod_defperms.js new file mode 100644 index 000000000..c89142579 --- /dev/null +++ b/view/js/mod_defperms.js @@ -0,0 +1,32 @@ +$(document).ready(function() { + + $('#id_permcat').change(function() { + $('.loading-role-rotator').show(); + var permName = $('#id_permcat').val(); + loadConnectionRole(permName); + }); + + +}); + + +function loadConnectionRole(name) { + + if(! name) + name = 'default'; + + $('.defperms-edit input').each(function() { + if(! $(this).is(':disabled')) + $(this).removeAttr('checked'); + }); + + $.get('permcat/' + name, function(data) { + $(data.perms).each(function() { + if(this.value) + $('#id_perms_' + this.name).attr('checked','checked'); + }); + $('.loading-role-rotator').hide(); + }); +} + + |