Skip to content
Snippets Groups Projects
Commit 9ef24b9a authored by Vincent Petry's avatar Vincent Petry
Browse files

Keep share checkboxes together

- removed leading spaces before markup which can affect rendering in
  some cases
- added shareOption CSS class to group and keep share option checkbox +
  label
- moved ".showCruds" arrow into the matching shareOption to keep the
  arrow together with the checkbox
parent a6c92126
No related branches found
No related tags found
No related merge requests found
...@@ -63,6 +63,11 @@ ...@@ -63,6 +63,11 @@
white-space: normal; white-space: normal;
} }
#shareWithList .shareOption {
white-space: nowrap;
display: inline-block;
}
#shareWithList .unshare img, #shareWithList .showCruds img { #shareWithList .unshare img, #shareWithList .showCruds img {
vertical-align:text-bottom; /* properly align icons */ vertical-align:text-bottom; /* properly align icons */
} }
......
...@@ -16,42 +16,56 @@ ...@@ -16,42 +16,56 @@
var TEMPLATE = var TEMPLATE =
'<ul id="shareWithList" class="shareWithList">' + '<ul id="shareWithList" class="shareWithList">' +
'{{#each sharees}}' + '{{#each sharees}}' +
' <li data-share-id="{{shareId}}" data-share-type="{{shareType}}" data-share-with="{{shareWith}}">' + '<li data-share-id="{{shareId}}" data-share-type="{{shareType}}" data-share-with="{{shareWith}}">' +
' <a href="#" class="unshare"><span class="icon-loading-small hidden"></span><span class="icon icon-delete"></span><span class="hidden-visually">{{unshareLabel}}</span></a>' + '<a href="#" class="unshare"><span class="icon-loading-small hidden"></span><span class="icon icon-delete"></span><span class="hidden-visually">{{unshareLabel}}</span></a>' +
' {{#if avatarEnabled}}' + '{{#if avatarEnabled}}' +
' <div class="avatar {{#if modSeed}}imageplaceholderseed{{/if}}" data-username="{{shareWith}}" {{#if modSeed}}data-seed="{{shareWith}} {{shareType}}"{{/if}}></div>' + '<div class="avatar {{#if modSeed}}imageplaceholderseed{{/if}}" data-username="{{shareWith}}" {{#if modSeed}}data-seed="{{shareWith}} {{shareType}}"{{/if}}></div>' +
' {{/if}}' + '{{/if}}' +
' <span class="has-tooltip username" title="{{shareWith}}">{{shareWithDisplayName}}</span>' + '<span class="has-tooltip username" title="{{shareWith}}">{{shareWithDisplayName}}</span>' +
' {{#if mailNotificationEnabled}} {{#unless isRemoteShare}}' + '{{#if mailNotificationEnabled}} {{#unless isRemoteShare}}' +
' <input id="mail-{{cid}}-{{shareWith}}" type="checkbox" name="mailNotification" class="mailNotification checkbox" {{#if wasMailSent}}checked="checked"{{/if}} />' + '<span class="shareOption">' +
' <label for="mail-{{cid}}-{{shareWith}}">{{notifyByMailLabel}}</label>' + '<input id="mail-{{cid}}-{{shareWith}}" type="checkbox" name="mailNotification" class="mailNotification checkbox" {{#if wasMailSent}}checked="checked"{{/if}} />' +
' {{/unless}} {{/if}}' + '<label for="mail-{{cid}}-{{shareWith}}">{{notifyByMailLabel}}</label>' +
' {{#if isResharingAllowed}} {{#if sharePermissionPossible}} {{#unless isRemoteShare}}' + '</span>' +
' <input id="canShare-{{cid}}-{{shareWith}}" type="checkbox" name="share" class="permissions checkbox" {{#if hasSharePermission}}checked="checked"{{/if}} data-permissions="{{sharePermission}}" />' + '{{/unless}} {{/if}}' +
' <label for="canShare-{{cid}}-{{shareWith}}">{{canShareLabel}}</label>' + '{{#if isResharingAllowed}} {{#if sharePermissionPossible}} {{#unless isRemoteShare}}' +
' {{/unless}} {{/if}} {{/if}}' + '<span class="shareOption">' +
' {{#if editPermissionPossible}}' + '<input id="canShare-{{cid}}-{{shareWith}}" type="checkbox" name="share" class="permissions checkbox" {{#if hasSharePermission}}checked="checked"{{/if}} data-permissions="{{sharePermission}}" />' +
' <input id="canEdit-{{cid}}-{{shareWith}}" type="checkbox" name="edit" class="permissions checkbox" {{#if hasEditPermission}}checked="checked"{{/if}} />' + '<label for="canShare-{{cid}}-{{shareWith}}">{{canShareLabel}}</label>' +
' <label for="canEdit-{{cid}}-{{shareWith}}">{{canEditLabel}}</label>' + '</span>' +
' {{/if}}' + '{{/unless}} {{/if}} {{/if}}' +
' {{#unless isRemoteShare}}' + '{{#if editPermissionPossible}}' +
' <a href="#" class="showCruds"><img class="svg" alt="{{crudsLabel}}" src="{{triangleSImage}}"/></a>' + '<span class="shareOption">' +
' <div class="cruds hidden">' + '<input id="canEdit-{{cid}}-{{shareWith}}" type="checkbox" name="edit" class="permissions checkbox" {{#if hasEditPermission}}checked="checked"{{/if}} />' +
' {{#if createPermissionPossible}}' + '<label for="canEdit-{{cid}}-{{shareWith}}">{{canEditLabel}}</label>' +
' <input id="canCreate-{{cid}}-{{shareWith}}" type="checkbox" name="create" class="permissions checkbox" {{#if hasCreatePermission}}checked="checked"{{/if}} data-permissions="{{createPermission}}"/>' + '{{#unless isRemoteShare}}' +
' <label for="canCreate-{{cid}}-{{shareWith}}">{{createPermissionLabel}}</label>' + '<a href="#" class="showCruds"><img class="svg" alt="{{crudsLabel}}" src="{{triangleSImage}}"/></a>' +
' {{/if}}' + '{{/unless}}' +
' {{#if updatePermissionPossible}}' + '</span>' +
' <input id="canUpdate-{{cid}}-{{shareWith}}" type="checkbox" name="update" class="permissions checkbox" {{#if hasUpdatePermission}}checked="checked"{{/if}} data-permissions="{{updatePermission}}"/>' + '{{/if}}' +
' <label for="canUpdate-{{cid}}-{{shareWith}}">{{updatePermissionLabel}}</label>' + '{{#unless isRemoteShare}}' +
' {{/if}}' + '<div class="cruds hidden">' +
' {{#if deletePermissionPossible}} {{#unless isRemoteShare}}' + '{{#if createPermissionPossible}}' +
' <input id="canDelete-{{cid}}-{{shareWith}}" type="checkbox" name="delete" class="permissions checkbox" {{#if hasDeletePermission}}checked="checked"{{/if}} data-permissions="{{deletePermission}}"/>' + '<span class="shareOption">' +
' <label for="canDelete-{{cid}}-{{shareWith}}">{{deletePermissionLabel}}</label>' + '<input id="canCreate-{{cid}}-{{shareWith}}" type="checkbox" name="create" class="permissions checkbox" {{#if hasCreatePermission}}checked="checked"{{/if}} data-permissions="{{createPermission}}"/>' +
' {{/unless}} {{/if}}' + '<label for="canCreate-{{cid}}-{{shareWith}}">{{createPermissionLabel}}</label>' +
' </div>' + '</span>' +
' {{/unless}}' + '{{/if}}' +
' </li>' + '{{#if updatePermissionPossible}}' +
'<span class="shareOption">' +
'<input id="canUpdate-{{cid}}-{{shareWith}}" type="checkbox" name="update" class="permissions checkbox" {{#if hasUpdatePermission}}checked="checked"{{/if}} data-permissions="{{updatePermission}}"/>' +
'<label for="canUpdate-{{cid}}-{{shareWith}}">{{updatePermissionLabel}}</label>' +
'</span>' +
'{{/if}}' +
'{{#if deletePermissionPossible}} {{#unless isRemoteShare}}' +
'<span class="shareOption">' +
'<input id="canDelete-{{cid}}-{{shareWith}}" type="checkbox" name="delete" class="permissions checkbox" {{#if hasDeletePermission}}checked="checked"{{/if}} data-permissions="{{deletePermission}}"/>' +
'<label for="canDelete-{{cid}}-{{shareWith}}">{{deletePermissionLabel}}</label>' +
'</span>' +
'{{/unless}} {{/if}}' +
'</div>' +
'{{/unless}}' +
'</li>' +
'{{/each}}' + '{{/each}}' +
'</ul>' '</ul>'
; ;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment