Only execute dragdrop.js if device does not support touch events.

Also hide noscript controls for plugin manager differently, but show
them on no-js and touch devices. This is supposed to compensate the
fact that the dragdrop JS does not work on touch devices. Might need
a better solution long-term here.
This commit is contained in:
Matthias Mees 2014-01-20 12:32:36 +01:00
parent 98e2d2fd7c
commit c731c371d3
3 changed files with 40 additions and 27 deletions

View File

@ -1,4 +1,5 @@
$("document").ready(function() {
if (! Modernizr.touch){
$('.pluginmanager_sidebar .pluginmanager_container').sortable(getDragdropConfiguration('plugins_sidebar'));
$('.pluginmanager_event .pluginmanager_container').sortable(getDragdropConfiguration('plugins_event'));
$('.configuration_group .pluginmanager_container').sortable(getDragdropConfiguration('plugins_event'));
@ -27,4 +28,5 @@ $("document").ready(function() {
}
}
}
}
});

View File

@ -56,8 +56,7 @@
{/if}
</li>
<noscript>
<li class="pluginmanager_place">
<li class="pluginmanager_place nojs-controls">
<select name="serendipity[placement][{$plugin_data['name']}]">
{foreach $plugin_data.gopts as $k => $v}
{if {$plugin_data.is_plugin_editable} && $k == 'hide'}
@ -67,7 +66,7 @@
{/foreach}
</select>
</li>
<li class="pluginmanager_move">
<li class="pluginmanager_move nojs-controls">
{if $plugin_data.sort_idx == 0}
{else}
<a href="?{$serendipity_setFormTokenUrl}&amp;serendipity[adminModule]=plugins&amp;submit=move+up&amp;serendipity[plugin_to_move]={$plugin_data.key}{if $event_only}&amp;serendipity[event_plugin]=true{/if}">
@ -82,7 +81,6 @@
</a> {* i18n *}
{/if}
</li>
</noscript>
</ul>
</li>
{/foreach}

View File

@ -1933,6 +1933,19 @@ form > .button_link:first-of-type,
z-index: 2000;
}
/* Touch/no-js fallback */
.nojs-controls,
.touch .pluginmanager_grablet {
display: none;
visibility: hidden;
}
.no-js .nojs-controls,
.touch .nojs-controls {
display: block;
visibility: visible;
}
/* MEDIA DB
----------------------------------------------------------------- */