diff -u b/core/misc/tabledrag.js b/core/misc/tabledrag.js --- b/core/misc/tabledrag.js +++ b/core/misc/tabledrag.js @@ -122,14 +122,15 @@ // Add event bindings to the document. The self variable is passed along // as event handlers do not have direct access to the tableDrag object. - if(!Modernizr.touch) { - $(document).bind('mousemove', function (event) { return self.dragRow(event, self); }); - $(document).bind('mouseup', function (event) { return self.dropRow(event, self); }); - } - if(Modernizr.touch) { + if (Modernizr.touch) { $(document).bind('touchmove', function (event) { return self.dragRow(event.originalEvent.touches[0], self); }); $(document).bind('touchend', function (event) { return self.dropRow(event.originalEvent.touches[0], self); }); } + else { + $(document).bind('mousemove', function (event) { return self.dragRow(event, self); }); + $(document).bind('mouseup', function (event) { return self.dropRow(event, self); }); + } + // React to localStorage event showing or hiding weight columns. $(window).bind('storage', $.proxy(function (e) { // Only react to 'Drupal.tableDrag.showWeight' value change. @@ -322,22 +323,18 @@ $item.find('td:first').prepend(handle); } - // Conditionally add the touchstart action for the handle. - if(Modernizr.touch) { + if (Modernizr.touch) { handle.on('touchstart', function (event) { event.preventDefault(); event = event.originalEvent.touches[0]; self.dragStart(event, self, item); }); } - - // Conditionally add the mousedown action for the handle. - if(!Modernizr.touch) { + else { handle.mousedown(function (event) { event.preventDefault(); - self = self.dragStart(event, self, item); + self.dragStart(event, self, item); }); - } // Prevent the anchor tag from jumping us to the top of the page. @@ -345,15 +342,14 @@ e.preventDefault(); }); - // Similar to the hover event, add a class when the handle is focused. + // Set blur cleanup when a handle is focused. handle.focus(function () { - $(this).addClass('tabledrag-handle-hover'); self.safeBlur = true; }); - // Remove the handle class on blur and fire the same function as a mouseup. + // On blur, fire the same function as a touchend/mouseup. This is used to + // update values after a row has been moved through the keyboard support. handle.blur(function (event) { - $(this).removeClass('tabledrag-handle-hover'); if (self.rowObject && self.safeBlur) { self.dropRow(event, self); } @@ -624,8 +620,6 @@ // Functionality specific only to pointerup events. if (self.dragObject !== null) { - $droppedRow.find('.tabledrag-handle').removeClass('tabledrag-handle-hover'); - self.dragObject = null; $('body').removeClass('drag'); clearInterval(self.scrollInterval); @@ -650,7 +644,7 @@ * element. To do this we need the element's position and the target position. */ Drupal.tableDrag.prototype.getPointerOffset = function (target, event) { - var docPos = $(target).offset(); + var docPos = $(target).offset(); var pointerPos = this.pointerCoords(event); return { x: pointerPos.x - docPos.left, y: pointerPos.y - docPos.top }; }; reverted: --- b/core/modules/overlay/overlay-tabs.css +++ /dev/null @@ -1,103 +0,0 @@ -#overlay-tabs { - background-color: #fff; - border-radius: 5px 5px 0 0 ; - font-size: 13px; - font-size: 0.8125rem; - line-height: 1; -} -#overlay-tabs-primary, -#overlay-tabs-secondary { - list-style-type: none; - margin: 0; - padding: 0; - position: relative; -} -#overlay-tabs-primary li, -#overlay-tabs-secondary li { - float: left; - position: relative; -} -#overlay-tabs a { - display: block; -} -#overlay-tabs-primary { - background-color: #f2f2f0; - border-radius: 5px 5px 0 0; - border-top: 1px solid #b3b3b3; - font-size: 12px; - font-size: 0.75rem; -} -#overlay-tabs-primary:before, -#overlay-tabs-secondary:before { - content: ' '; - bottom: 0; - display: block; - height: 0; - position: absolute; - width: 100%; -} -#overlay-tabs-primary:before { - border-bottom: 1px solid #b3b3b3; -} -#overlay-tabs-secondary:before { - border-bottom: 1px solid #d9d8d4; -} -#overlay-tabs-primary li { - margin-bottom: -1px; - top: -1px; -} -#overlay-tabs-primary .active{ - z-index: 1; -} -#overlay-tabs-primary a { - border-top: 1px solid #b3b3b3; - border-left: 1px solid #b3b3b3; - border-top-left-radius: 5px; - color: #0074bd; - font-weight: bold; - padding: 0.6667em 1.25em; - text-decoration: none; - text-transform: uppercase; -} -#overlay-tabs-primary a:hover { - background-color: #fff; - color: #007ac7; - text-decoration: none; } -#overlay-tabs-primary a:active { - color: #004f80; -} -#overlay-tabs-primary .active a { - background-color: #ffffff; - border-right: 1px solid #b3b3b3; - border-top-right-radius: 5px; - /* Use two short box shadows, one shifted right and one shifted left so that - we don't have the shadow bleed under the bottom of the tab. */ - -webkit-box-shadow: 2px -1px 2px -1px rgba(0, 0, 0, 0.2), -2px -1px 2px -1px rgba(0, 0, 0, 0.2); - -moz-box-shadow: 2px -1px 2px -1px rgba(0, 0, 0, 0.2), -2px -1px 2px -1px rgba(0, 0, 0, 0.2); - box-shadow: 2px -1px 2px -1px rgba(0, 0, 0, 0.2), -2px -1px 2px -1px rgba(0, 0, 0, 0.2); - color: #004f80; -} -#overlay-tabs-primary .active ~ li a { - border-left: 0; - border-right: 1px solid #b3b3b3; - border-radius: 0 5px 0 0; -} - -#overlay-tabs-secondary a { - border-bottom: 1px solid transparent; - color: #0074bd; - margin-left: 1.1538em; - padding: 0.75em 0 0.333em; -} -#overlay-tabs-secondary .active a { - border-bottom-color: #004f80; - color: #004f80; -} -#overlay-tabs-secondary a:focus, -#overlay-tabs-secondary a:hover { - color: #008ee6 !important; - border-bottom-color: #008ee6 !important; -} -#overlay-tabs-secondary a:hover { - text-decoration: none; -}