Skip to content

Commit

Permalink
ZMI: permission table compressed for safari (#733)
Browse files Browse the repository at this point in the history
  • Loading branch information
drfho authored and dataflake committed Nov 15, 2019
1 parent 6814bf7 commit dbe7e6e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/OFS/dtml/properties.dtml
Expand Up @@ -162,12 +162,12 @@
</form>

<dtml-if property_extensible_schema__>
<form action="<dtml-var "REQUEST.URL1" html_quote>/manage_addProperty" method="post" class="form-inline">
<form action="<dtml-var "REQUEST.URL1" html_quote>/manage_addProperty" method="post">
<p class="form-help mt-5">
To add a new property, enter a name, type and value for the new
property and click the <em>Add</em>-button.
</p>
<div class="form-group zmi-controls mt-2">
<div class="form-group form-inline zmi-controls mt-2">
<input type="text" placeholder="Name" title="Name" class="form-control" name="id:<dtml-var "REQUEST.charset.lower()=='utf-8' and 'UTF-8:' or ''">string" value="" />
<select name="type" title="Data Type"placeholder="Type" class="form-control">
<option>boolean</option>
Expand Down
6 changes: 5 additions & 1 deletion src/zmi/styles/resources/zmi_base.css
Expand Up @@ -380,13 +380,17 @@ form.zmi-upload {
overflow: hidden;
display: inline-block;
text-align: center;
object-fit: contain;
}
.zmi .compress th.zmi-rolename > div > span {
text-align: left;
}

@media (max-width: 768px) {
.zmi th.blank > div > span {
width: 110px;
overflow: hidden;
display: inline-block;
text-align: left;
}
.zmi .zmi-table-head th {
border:none;
Expand Down
6 changes: 4 additions & 2 deletions src/zmi/styles/resources/zmi_base.js
Expand Up @@ -6,7 +6,9 @@
function isURL(str) {
return /^(?:\w+:)?\/\/\S*$/.test(str);
};

function isSafari() {
return /^((?!chrome).)*safari/i.test(navigator.userAgent);
}

// NAVBAR-FUNCTIONS

Expand Down Expand Up @@ -229,7 +231,7 @@ $(function() {
// COMPRESS USER PERMISSIONS TABLE SIZE
if ($('body.zmi-manage_access').length !== 0) {
function resize_permissions_table() {
if ( $('#table-permissions').width() > $(window).width() ) {
if ( $('#table-permissions').width() > $(window).width() || isSafari() ) {
$('#table-permissions').addClass('compress');
}
}
Expand Down

0 comments on commit dbe7e6e

Please sign in to comment.