Skip to content

Commit 6ac4ef3

Browse files
paytenadrianfish
authored andcommitted
SAK-31799 make favorites clickable on mobile (sakaiproject#3943)
* SAK-31799 Allow favorite site links to be clickable on mobile devices - Now that links are clickable, make the drag handle icon the actual drag handle for dragging - Also reinstate the drag icon on mobile devices * SAK-31799 Fix favorites dragging not working on some pages by ensuring that touch-punch is included for touch devices
1 parent 8cf6f55 commit 6ac4ef3

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

portal/portal-render-engine-impl/pack/src/webapp/vm/morpheus/site.vm

+3
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@
8282
document.write('\x3Cscript src="${pageWebjarsPath}bootstrap/3.3.7/js/bootstrap.min.js$!{portalCDNQuery}">'+'\x3C/script>')
8383
document.write('\x3Cscript src="${pageWebjarsPath}jquery-ui/1.11.3/jquery-ui.min.js$!{portalCDNQuery}">'+'\x3C/script>')
8484
document.write('\x3Clink rel="stylesheet" href="${pageWebjarsPath}jquery-ui/1.11.3/jquery-ui.min.css$!{portalCDNQuery}"/>')
85+
if (Modernizr.touch) {
86+
document.write('\x3Cscript type="text/javascript" src="${pageWebjarsPath}jquery-ui-touch-punch/0.2.3/jquery.ui.touch-punch.min.js$!{portalCDNQuery}">'+'\x3C/script>')
87+
}
8588
window.console && console.log('Portal scripts loaded JQ+MI+BS+UI');
8689
} else {
8790
if (typeof jQuery.migrateWarnings == 'undefined') {

reference/library/src/morpheus-master/js/src/sakai.morpheus.more.sites.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -525,25 +525,22 @@ $PBJQ(document).ready(function($){
525525
var favoriteItem = itemsBySiteId[siteid].clone(false);
526526

527527
favoriteItem.addClass('organize-favorite-item').data('site-id', siteid);
528-
var dragHandle = $PBJQ('<i class="fa fa-bars fav-drag-handle"></i>');
528+
var dragHandle = $PBJQ('<a href="javascript:void(0);" class="fav-drag-handle"><i class="fa fa-bars"></i></a>');
529529

530530
// Hide the tool dropdown
531531
$PBJQ('.toolMenus', favoriteItem).remove();
532532

533533
// Show a drag handle
534534
favoriteItem.append(dragHandle);
535535

536-
// And disable the link to site so we don't accidentally hit it while
537-
// dragging
538-
$PBJQ(favoriteItem).find('.fav-title a').attr('href', null);
539-
540536
list.append(favoriteItem);
541537

542538
// Make sure the item is visible, just in case it was hidden on the other tab
543539
favoriteItem.show();
544540
});
545541

546542
list.sortable({
543+
handle: ".fav-drag-handle",
547544
stop: function () {
548545
// Update our ordering based on the new selection
549546
favoritesList = list.find('.organize-favorite-item').map(function () {

reference/library/src/morpheus-master/sass/modules/more-sites/_base.scss

+2-5
Original file line numberDiff line numberDiff line change
@@ -389,16 +389,13 @@ ul.favoriteSiteList{
389389
.fav-drag-handle{
390390
display: inline-block;
391391
position: relative;
392-
right: -4px;
392+
right: 2px;
393+
padding: 0 6px;
393394
color: $tool-border-color;
394395
cursor: move; /* fallback if grab cursor is unsupported */
395396
cursor: grab;
396397
cursor: -moz-grab;
397398
cursor: -webkit-grab;
398-
399-
@media #{$phone}{
400-
display: none;
401-
}
402399
}
403400
.fav-drag-handle:active{
404401
cursor: grabbing;

0 commit comments

Comments
 (0)