aboutsummaryrefslogtreecommitdiffstats
path: root/view
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2016-08-04 21:26:30 +0200
committerMario Vavti <mario@mariovavti.com>2016-08-04 21:26:30 +0200
commit7e5428c69703e16f011e362a9865fe50d4841ddb (patch)
treefe0ed59eb11177666968242302645597eb8fa36e /view
parent036b72757c0dd24cb468e5d02f717de9dffe67cb (diff)
downloadvolse-hubzilla-7e5428c69703e16f011e362a9865fe50d4841ddb.tar.gz
volse-hubzilla-7e5428c69703e16f011e362a9865fe50d4841ddb.tar.bz2
volse-hubzilla-7e5428c69703e16f011e362a9865fe50d4841ddb.zip
multi acl: provide a acl-form-trigger class which comes handy in certain situations
Diffstat (limited to 'view')
-rw-r--r--view/js/acl.js9
-rwxr-xr-xview/tpl/photo_view.tpl2
-rwxr-xr-xview/tpl/photos_recent.tpl2
3 files changed, 7 insertions, 6 deletions
diff --git a/view/js/acl.js b/view/js/acl.js
index 175462250..9b08571ae 100644
--- a/view/js/acl.js
+++ b/view/js/acl.js
@@ -48,6 +48,7 @@ function ACL(backend_url) {
$(document).on('focus', '.acl-form', that.get_form_data);
$(document).on('click', '.acl-form', that.get_form_data);
+ $(document).on('click', '.acl-form-trigger', that.get_form_data);
$(document).on('click','.acl-button-show',that.on_button_show);
$(document).on('click','.acl-button-hide',that.on_button_hide);
@@ -71,10 +72,10 @@ ACL.prototype.get_form_data = function(event) {
console.log(form_id);
- that.allow_cid = ($(this).data('allow_cid') || []);
- that.allow_gid = ($(this).data('allow_gid') || []);
- that.deny_cid = ($(this).data('deny_cid') || []);
- that.deny_gid = ($(this).data('deny_gid') || []);
+ that.allow_cid = (that.form_id.data('allow_cid') || []);
+ that.allow_gid = (that.form_id.data('allow_gid') || []);
+ that.deny_cid = (that.form_id.data('deny_cid') || []);
+ that.deny_gid = (that.form_id.data('deny_gid') || []);
that.update_view();
that.on_submit();
diff --git a/view/tpl/photo_view.tpl b/view/tpl/photo_view.tpl
index f81572b8c..ec827d990 100755
--- a/view/tpl/photo_view.tpl
+++ b/view/tpl/photo_view.tpl
@@ -23,7 +23,7 @@
{{/if}}
{{if $edit}}
<li class="nav-item">
- <a class="nav-link" href="#" title="" onclick="openClose('photo-edit'); return false;"><i class="fa fa-pencil"></i>&nbsp;{{$edit.edit}}</a>
+ <a class="nav-link acl-form-trigger" href="#" title="" onclick="openClose('photo-edit'); return false;" data-form_id="photo_edit_form"><i class="fa fa-pencil"></i>&nbsp;{{$edit.edit}}</a>
</li>
{{/if}}
</ul>
diff --git a/view/tpl/photos_recent.tpl b/view/tpl/photos_recent.tpl
index 139f27a23..4cb1bc306 100755
--- a/view/tpl/photos_recent.tpl
+++ b/view/tpl/photos_recent.tpl
@@ -2,7 +2,7 @@
<div class="section-title-wrapper">
<div class="pull-right">
{{if $can_post}}
- <button class="btn btn-xs btn-success" title="{{$usage}}" onclick="openClose('photo-upload-form');"><i class="fa fa-arrow-circle-o-up"></i>&nbsp;{{$upload.0}}</button>
+ <button class="btn btn-xs btn-success acl-form-trigger" title="{{$usage}}" onclick="openClose('photo-upload-form');" data-form_id="photos-upload-form"><i class="fa fa-arrow-circle-o-up"></i>&nbsp;{{$upload.0}}</button>
{{/if}}
<button id="fullscreen-btn" type="button" class="btn btn-default btn-xs" onclick="makeFullScreen();"><i class="fa fa-expand"></i></button>
<button id="inline-btn" type="button" class="btn btn-default btn-xs" onclick="makeFullScreen(false);"><i class="fa fa-compress"></i></button>