mirror of
https://github.com/wallabag/wallabag.git
synced 2025-01-24 15:48:08 +00:00
fix #1457
This commit is contained in:
parent
8a60bc4cc2
commit
9c8f7af196
5 changed files with 8446 additions and 8323 deletions
|
@ -146,7 +146,11 @@ main {
|
||||||
<aside>
|
<aside>
|
||||||
<a href="{{ entry.url|e }}" target="_blank" title="{% trans %}original{% endtrans %} : {{ entry.title|e }}" class="tool link mdi-content-link"> <span>{{ entry.domainName }}</span></a>
|
<a href="{{ entry.url|e }}" target="_blank" title="{% trans %}original{% endtrans %} : {{ entry.title|e }}" class="tool link mdi-content-link"> <span>{{ entry.domainName }}</span></a>
|
||||||
<div id="list">
|
<div id="list">
|
||||||
{% for tag in entry.tags %}<span><a href="#">{{ tag.label }}</a></span>{% endfor %}
|
{% for tag in entry.tags %}
|
||||||
|
<div class="chip">
|
||||||
|
{{ tag.label }}<i class="mdi-navigation-close material-icons"></i>
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if entry.previewPicture is not null %}
|
{% if entry.previewPicture is not null %}
|
||||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
|
@ -1,5 +1,5 @@
|
||||||
/*!
|
/*!
|
||||||
* Materialize v0.97.0 (http://materializecss.com)
|
* Materialize v0.97.1 (http://materializecss.com)
|
||||||
* Copyright 2014-2015 Materialize
|
* Copyright 2014-2015 Materialize
|
||||||
* MIT License (https://raw.githubusercontent.com/Dogfalo/materialize/master/LICENSE)
|
* MIT License (https://raw.githubusercontent.com/Dogfalo/materialize/master/LICENSE)
|
||||||
*/
|
*/
|
||||||
|
@ -252,7 +252,7 @@ jQuery.extend( jQuery.easing,
|
||||||
};
|
};
|
||||||
})(Hammer.Manager.prototype.emit);
|
})(Hammer.Manager.prototype.emit);
|
||||||
}));
|
}));
|
||||||
;Materialize = {};
|
;window.Materialize = {};
|
||||||
|
|
||||||
// Unique ID
|
// Unique ID
|
||||||
Materialize.guid = (function() {
|
Materialize.guid = (function() {
|
||||||
|
@ -442,7 +442,8 @@ else {
|
||||||
constrain_width: true, // Constrains width of dropdown to the activator
|
constrain_width: true, // Constrains width of dropdown to the activator
|
||||||
hover: false,
|
hover: false,
|
||||||
gutter: 0, // Spacing from edge
|
gutter: 0, // Spacing from edge
|
||||||
belowOrigin: false
|
belowOrigin: false,
|
||||||
|
alignment: 'left'
|
||||||
};
|
};
|
||||||
|
|
||||||
this.each(function(){
|
this.each(function(){
|
||||||
|
@ -465,6 +466,8 @@ else {
|
||||||
options.gutter = origin.data('gutter');
|
options.gutter = origin.data('gutter');
|
||||||
if (origin.data('beloworigin') !== undefined)
|
if (origin.data('beloworigin') !== undefined)
|
||||||
options.belowOrigin = origin.data('beloworigin');
|
options.belowOrigin = origin.data('beloworigin');
|
||||||
|
if (origin.data('alignment') !== undefined)
|
||||||
|
options.alignment = origin.data('alignment');
|
||||||
}
|
}
|
||||||
|
|
||||||
updateOptions();
|
updateOptions();
|
||||||
|
@ -487,27 +490,46 @@ else {
|
||||||
if (options.constrain_width === true) {
|
if (options.constrain_width === true) {
|
||||||
activates.css('width', origin.outerWidth());
|
activates.css('width', origin.outerWidth());
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
activates.css('white-space', 'nowrap');
|
||||||
|
}
|
||||||
var offset = 0;
|
var offset = 0;
|
||||||
if (options.belowOrigin === true) {
|
if (options.belowOrigin === true) {
|
||||||
offset = origin.height();
|
offset = origin.height();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle edge alignment
|
// Offscreen detection
|
||||||
var offsetLeft = origin.offset().left;
|
var offsetLeft = origin.offset().left;
|
||||||
var width_difference = 0;
|
var activatesLeft, width_difference, gutter_spacing;
|
||||||
var gutter_spacing = options.gutter;
|
|
||||||
|
|
||||||
|
|
||||||
if (offsetLeft + activates.innerWidth() > $(window).width()) {
|
if (offsetLeft + activates.innerWidth() > $(window).width()) {
|
||||||
width_difference = origin.innerWidth() - activates.innerWidth();
|
options.alignment = 'right';
|
||||||
gutter_spacing = gutter_spacing * -1;
|
}
|
||||||
|
else if (offsetLeft - activates.innerWidth() + origin.innerWidth() < 0) {
|
||||||
|
options.alignment = 'left';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Handle edge alignment
|
||||||
|
if (options.alignment === 'left') {
|
||||||
|
width_difference = 0;
|
||||||
|
gutter_spacing = options.gutter;
|
||||||
|
activatesLeft = origin.position().left + width_difference + gutter_spacing;
|
||||||
|
|
||||||
|
// Position dropdown
|
||||||
|
activates.css({ left: activatesLeft });
|
||||||
|
}
|
||||||
|
else if (options.alignment === 'right') {
|
||||||
|
var offsetRight = $(window).width() - offsetLeft - origin.innerWidth();
|
||||||
|
width_difference = 0;
|
||||||
|
gutter_spacing = options.gutter;
|
||||||
|
activatesLeft = ( $(window).width() - origin.position().left - origin.innerWidth() ) + gutter_spacing;
|
||||||
|
|
||||||
|
// Position dropdown
|
||||||
|
activates.css({ right: activatesLeft });
|
||||||
|
}
|
||||||
// Position dropdown
|
// Position dropdown
|
||||||
activates.css({
|
activates.css({
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
top: origin.position().top + offset,
|
top: origin.position().top + offset,
|
||||||
left: origin.position().left + width_difference + gutter_spacing
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
@ -1100,11 +1122,6 @@ $(document).ready(function(){
|
||||||
window_width = $(window).width();
|
window_width = $(window).width();
|
||||||
|
|
||||||
$this.width('100%');
|
$this.width('100%');
|
||||||
// Set Tab Width for each tab
|
|
||||||
var $num_tabs = $(this).children('li').length;
|
|
||||||
$this.children('li').each(function() {
|
|
||||||
$(this).width((100/$num_tabs)+'%');
|
|
||||||
});
|
|
||||||
var $active, $content, $links = $this.find('li.tab a'),
|
var $active, $content, $links = $this.find('li.tab a'),
|
||||||
$tabs_width = $this.width(),
|
$tabs_width = $this.width(),
|
||||||
$tab_width = $this.find('li').first().outerWidth(),
|
$tab_width = $this.find('li').first().outerWidth(),
|
||||||
|
@ -1234,153 +1251,164 @@ $(document).ready(function(){
|
||||||
var defaults = {
|
var defaults = {
|
||||||
delay: 350
|
delay: 350
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Remove tooltip from the activator
|
||||||
|
if (options === "remove") {
|
||||||
|
this.each(function(){
|
||||||
|
$('#' + $(this).attr('data-tooltip-id')).remove();
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
options = $.extend(defaults, options);
|
options = $.extend(defaults, options);
|
||||||
|
|
||||||
//Remove previously created html
|
|
||||||
$('.material-tooltip').remove();
|
|
||||||
|
|
||||||
return this.each(function(){
|
return this.each(function(){
|
||||||
|
var tooltipId = Materialize.guid();
|
||||||
var origin = $(this);
|
var origin = $(this);
|
||||||
|
origin.attr('data-tooltip-id', tooltipId);
|
||||||
|
|
||||||
// Create Text span
|
// Create Text span
|
||||||
var tooltip_text = $('<span></span>').text(origin.attr('data-tooltip'));
|
var tooltip_text = $('<span></span>').text(origin.attr('data-tooltip'));
|
||||||
|
|
||||||
// Create tooltip
|
// Create tooltip
|
||||||
var newTooltip = $('<div></div>');
|
var newTooltip = $('<div></div>');
|
||||||
newTooltip.addClass('material-tooltip').append(tooltip_text);
|
newTooltip.addClass('material-tooltip').append(tooltip_text)
|
||||||
newTooltip.appendTo($('body'));
|
.appendTo($('body'))
|
||||||
|
.attr('id', tooltipId);
|
||||||
|
|
||||||
var backdrop = $('<div></div>').addClass('backdrop');
|
var backdrop = $('<div></div>').addClass('backdrop');
|
||||||
backdrop.appendTo(newTooltip);
|
backdrop.appendTo(newTooltip);
|
||||||
backdrop.css({ top: 0, left:0 });
|
backdrop.css({ top: 0, left:0 });
|
||||||
|
|
||||||
|
|
||||||
//Destroy previously binded events
|
//Destroy previously binded events
|
||||||
$(this).off('mouseenter mouseleave');
|
origin.off('mouseenter.tooltip mouseleave.tooltip');
|
||||||
// Mouse In
|
// Mouse In
|
||||||
$(this).on({
|
origin.on({
|
||||||
mouseenter: function(e) {
|
'mouseenter.tooltip': function(e) {
|
||||||
var tooltip_delay = origin.data("delay");
|
var tooltip_delay = origin.data("delay");
|
||||||
tooltip_delay = (tooltip_delay === undefined || tooltip_delay === '') ? options.delay : tooltip_delay;
|
tooltip_delay = (tooltip_delay === undefined || tooltip_delay === '') ? options.delay : tooltip_delay;
|
||||||
counter = 0;
|
counter = 0;
|
||||||
counterInterval = setInterval(function(){
|
counterInterval = setInterval(function(){
|
||||||
counter += 10;
|
counter += 10;
|
||||||
if (counter >= tooltip_delay && started === false) {
|
if (counter >= tooltip_delay && started === false) {
|
||||||
started = true;
|
started = true;
|
||||||
newTooltip.css({ display: 'block', left: '0px', top: '0px' });
|
newTooltip.css({ display: 'block', left: '0px', top: '0px' });
|
||||||
|
|
||||||
// Set Tooltip text
|
// Set Tooltip text
|
||||||
newTooltip.children('span').text(origin.attr('data-tooltip'));
|
newTooltip.children('span').text(origin.attr('data-tooltip'));
|
||||||
|
|
||||||
// Tooltip positioning
|
// Tooltip positioning
|
||||||
var originWidth = origin.outerWidth();
|
var originWidth = origin.outerWidth();
|
||||||
var originHeight = origin.outerHeight();
|
var originHeight = origin.outerHeight();
|
||||||
var tooltipPosition = origin.attr('data-position');
|
var tooltipPosition = origin.attr('data-position');
|
||||||
var tooltipHeight = newTooltip.outerHeight();
|
var tooltipHeight = newTooltip.outerHeight();
|
||||||
var tooltipWidth = newTooltip.outerWidth();
|
var tooltipWidth = newTooltip.outerWidth();
|
||||||
var tooltipVerticalMovement = '0px';
|
var tooltipVerticalMovement = '0px';
|
||||||
var tooltipHorizontalMovement = '0px';
|
var tooltipHorizontalMovement = '0px';
|
||||||
var scale_factor = 8;
|
var scale_factor = 8;
|
||||||
|
|
||||||
if (tooltipPosition === "top") {
|
if (tooltipPosition === "top") {
|
||||||
// Top Position
|
// Top Position
|
||||||
newTooltip.css({
|
|
||||||
top: origin.offset().top - tooltipHeight - margin,
|
|
||||||
left: origin.offset().left + originWidth/2 - tooltipWidth/2
|
|
||||||
});
|
|
||||||
tooltipVerticalMovement = '-10px';
|
|
||||||
backdrop.css({
|
|
||||||
borderRadius: '14px 14px 0 0',
|
|
||||||
transformOrigin: '50% 90%',
|
|
||||||
marginTop: tooltipHeight,
|
|
||||||
marginLeft: (tooltipWidth/2) - (backdrop.width()/2)
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// Left Position
|
|
||||||
else if (tooltipPosition === "left") {
|
|
||||||
newTooltip.css({
|
newTooltip.css({
|
||||||
top: origin.offset().top + originHeight/2 - tooltipHeight/2,
|
top: origin.offset().top - tooltipHeight - margin,
|
||||||
left: origin.offset().left - tooltipWidth - margin
|
|
||||||
});
|
|
||||||
tooltipHorizontalMovement = '-10px';
|
|
||||||
backdrop.css({
|
|
||||||
width: '14px',
|
|
||||||
height: '14px',
|
|
||||||
borderRadius: '14px 0 0 14px',
|
|
||||||
transformOrigin: '95% 50%',
|
|
||||||
marginTop: tooltipHeight/2,
|
|
||||||
marginLeft: tooltipWidth
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// Right Position
|
|
||||||
else if (tooltipPosition === "right") {
|
|
||||||
newTooltip.css({
|
|
||||||
top: origin.offset().top + originHeight/2 - tooltipHeight/2,
|
|
||||||
left: origin.offset().left + originWidth + margin
|
|
||||||
});
|
|
||||||
tooltipHorizontalMovement = '+10px';
|
|
||||||
backdrop.css({
|
|
||||||
width: '14px',
|
|
||||||
height: '14px',
|
|
||||||
borderRadius: '0 14px 14px 0',
|
|
||||||
transformOrigin: '5% 50%',
|
|
||||||
marginTop: tooltipHeight/2,
|
|
||||||
marginLeft: '0px'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// Bottom Position
|
|
||||||
newTooltip.css({
|
|
||||||
top: origin.offset().top + origin.outerHeight() + margin,
|
|
||||||
left: origin.offset().left + originWidth/2 - tooltipWidth/2
|
left: origin.offset().left + originWidth/2 - tooltipWidth/2
|
||||||
});
|
});
|
||||||
tooltipVerticalMovement = '+10px';
|
tooltipVerticalMovement = '-10px';
|
||||||
backdrop.css({
|
backdrop.css({
|
||||||
|
borderRadius: '14px 14px 0 0',
|
||||||
|
transformOrigin: '50% 90%',
|
||||||
|
marginTop: tooltipHeight,
|
||||||
marginLeft: (tooltipWidth/2) - (backdrop.width()/2)
|
marginLeft: (tooltipWidth/2) - (backdrop.width()/2)
|
||||||
|
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
// Left Position
|
||||||
|
else if (tooltipPosition === "left") {
|
||||||
|
newTooltip.css({
|
||||||
|
top: origin.offset().top + originHeight/2 - tooltipHeight/2,
|
||||||
|
left: origin.offset().left - tooltipWidth - margin
|
||||||
|
});
|
||||||
|
tooltipHorizontalMovement = '-10px';
|
||||||
|
backdrop.css({
|
||||||
|
width: '14px',
|
||||||
|
height: '14px',
|
||||||
|
borderRadius: '14px 0 0 14px',
|
||||||
|
transformOrigin: '95% 50%',
|
||||||
|
marginTop: tooltipHeight/2,
|
||||||
|
marginLeft: tooltipWidth
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// Right Position
|
||||||
|
else if (tooltipPosition === "right") {
|
||||||
|
newTooltip.css({
|
||||||
|
top: origin.offset().top + originHeight/2 - tooltipHeight/2,
|
||||||
|
left: origin.offset().left + originWidth + margin
|
||||||
|
});
|
||||||
|
tooltipHorizontalMovement = '+10px';
|
||||||
|
backdrop.css({
|
||||||
|
width: '14px',
|
||||||
|
height: '14px',
|
||||||
|
borderRadius: '0 14px 14px 0',
|
||||||
|
transformOrigin: '5% 50%',
|
||||||
|
marginTop: tooltipHeight/2,
|
||||||
|
marginLeft: '0px'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// Bottom Position
|
||||||
|
newTooltip.css({
|
||||||
|
top: origin.offset().top + origin.outerHeight() + margin,
|
||||||
|
left: origin.offset().left + originWidth/2 - tooltipWidth/2
|
||||||
|
});
|
||||||
|
tooltipVerticalMovement = '+10px';
|
||||||
|
backdrop.css({
|
||||||
|
marginLeft: (tooltipWidth/2) - (backdrop.width()/2)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Calculate Scale to fill
|
||||||
|
scale_factor = tooltipWidth / 8;
|
||||||
|
if (scale_factor < 8) {
|
||||||
|
scale_factor = 8;
|
||||||
|
}
|
||||||
|
if (tooltipPosition === "right" || tooltipPosition === "left") {
|
||||||
|
scale_factor = tooltipWidth / 10;
|
||||||
|
if (scale_factor < 6)
|
||||||
|
scale_factor = 6;
|
||||||
|
}
|
||||||
|
|
||||||
|
newTooltip.velocity({ marginTop: tooltipVerticalMovement, marginLeft: tooltipHorizontalMovement}, { duration: 350, queue: false })
|
||||||
|
.velocity({opacity: 1}, {duration: 300, delay: 50, queue: false});
|
||||||
|
backdrop.css({ display: 'block' })
|
||||||
|
.velocity({opacity:1},{duration: 55, delay: 0, queue: false})
|
||||||
|
.velocity({scale: scale_factor}, {duration: 300, delay: 0, queue: false, easing: 'easeInOutQuad'});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}, 10); // End Interval
|
||||||
|
|
||||||
// Calculate Scale to fill
|
// Mouse Out
|
||||||
scale_factor = tooltipWidth / 8;
|
},
|
||||||
if (scale_factor < 8) {
|
'mouseleave.tooltip': function(){
|
||||||
scale_factor = 8;
|
// Reset State
|
||||||
}
|
clearInterval(counterInterval);
|
||||||
if (tooltipPosition === "right" || tooltipPosition === "left") {
|
counter = 0;
|
||||||
scale_factor = tooltipWidth / 10;
|
|
||||||
if (scale_factor < 6)
|
|
||||||
scale_factor = 6;
|
|
||||||
}
|
|
||||||
|
|
||||||
newTooltip.velocity({ opacity: 1, marginTop: tooltipVerticalMovement, marginLeft: tooltipHorizontalMovement}, { duration: 350, queue: false });
|
// Animate back
|
||||||
backdrop.css({ display: 'block' })
|
newTooltip.velocity({
|
||||||
.velocity({opacity:1},{duration: 55, delay: 0, queue: false})
|
opacity: 0, marginTop: 0, marginLeft: 0}, { duration: 225, queue: false, delay: 225 }
|
||||||
.velocity({scale: scale_factor}, {duration: 300, delay: 0, queue: false, easing: 'easeInOutQuad'});
|
);
|
||||||
|
backdrop.velocity({opacity: 0, scale: 1}, {
|
||||||
}
|
duration:225,
|
||||||
}, 10); // End Interval
|
delay: 275, queue: false,
|
||||||
|
complete: function(){
|
||||||
// Mouse Out
|
backdrop.css('display', 'none');
|
||||||
},
|
newTooltip.css('display', 'none');
|
||||||
mouseleave: function(){
|
started = false;}
|
||||||
// Reset State
|
});
|
||||||
clearInterval(counterInterval);
|
}
|
||||||
counter = 0;
|
|
||||||
|
|
||||||
// Animate back
|
|
||||||
newTooltip.velocity({
|
|
||||||
opacity: 0, marginTop: 0, marginLeft: 0}, { duration: 225, queue: false, delay: 275 }
|
|
||||||
);
|
|
||||||
backdrop.velocity({opacity: 0, scale: 1}, {
|
|
||||||
duration:225,
|
|
||||||
delay: 275, queue: false,
|
|
||||||
complete: function(){
|
|
||||||
backdrop.css('display', 'none');
|
|
||||||
newTooltip.css('display', 'none');
|
|
||||||
started = false;}
|
|
||||||
});
|
});
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1799,8 +1827,19 @@ $(document).ready(function(){
|
||||||
toast.classList.add(classes[i]);
|
toast.classList.add(classes[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
toast.innerHTML = html;
|
// If type of parameter is HTML Element
|
||||||
|
if ( typeof HTMLElement === "object" ? html instanceof HTMLElement : html && typeof html === "object" && html !== null && html.nodeType === 1 && typeof html.nodeName==="string"
|
||||||
|
) {
|
||||||
|
toast.appendChild(html);
|
||||||
|
}
|
||||||
|
else if (html instanceof jQuery) {
|
||||||
|
// Check if it is jQuery object
|
||||||
|
toast.appendChild(html[0]);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// Insert as text;
|
||||||
|
toast.innerHTML = html;
|
||||||
|
}
|
||||||
// Bind hammer
|
// Bind hammer
|
||||||
var hammerHandler = new Hammer(toast, {prevent_default: false});
|
var hammerHandler = new Hammer(toast, {prevent_default: false});
|
||||||
hammerHandler.on('pan', function(e) {
|
hammerHandler.on('pan', function(e) {
|
||||||
|
@ -1872,17 +1911,18 @@ $(document).ready(function(){
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add Touch Area
|
// Add Touch Area
|
||||||
$('body').append($('<div class="drag-target"></div>'));
|
var dragTarget = $('<div class="drag-target"></div>');
|
||||||
|
$('body').append(dragTarget);
|
||||||
|
|
||||||
if (options.edge == 'left') {
|
if (options.edge == 'left') {
|
||||||
menu_id.css('left', -1 * (options.menuWidth + 10));
|
menu_id.css('left', -1 * (options.menuWidth + 10));
|
||||||
$('.drag-target').css({'left': 0}); // Add Touch Area
|
dragTarget.css({'left': 0}); // Add Touch Area
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
menu_id.addClass('right-aligned') // Change text-alignment to right
|
menu_id.addClass('right-aligned') // Change text-alignment to right
|
||||||
.css('right', -1 * (options.menuWidth + 10))
|
.css('right', -1 * (options.menuWidth + 10))
|
||||||
.css('left', '');
|
.css('left', '');
|
||||||
$('.drag-target').css({'right': 0}); // Add Touch Area
|
dragTarget.css({'right': 0}); // Add Touch Area
|
||||||
}
|
}
|
||||||
|
|
||||||
// If fixed sidenav, bring menu out
|
// If fixed sidenav, bring menu out
|
||||||
|
@ -1935,7 +1975,7 @@ $(document).ready(function(){
|
||||||
} });
|
} });
|
||||||
if (options.edge === 'left') {
|
if (options.edge === 'left') {
|
||||||
// Reset phantom div
|
// Reset phantom div
|
||||||
$('.drag-target').css({width: '', right: '', left: '0'});
|
dragTarget.css({width: '', right: '', left: '0'});
|
||||||
menu_id.velocity(
|
menu_id.velocity(
|
||||||
{left: -1 * (options.menuWidth + 10)},
|
{left: -1 * (options.menuWidth + 10)},
|
||||||
{ duration: 200,
|
{ duration: 200,
|
||||||
|
@ -1953,7 +1993,7 @@ $(document).ready(function(){
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Reset phantom div
|
// Reset phantom div
|
||||||
$('.drag-target').css({width: '', right: '0', left: ''});
|
dragTarget.css({width: '', right: '0', left: ''});
|
||||||
menu_id.velocity(
|
menu_id.velocity(
|
||||||
{right: -1 * (options.menuWidth + 10)},
|
{right: -1 * (options.menuWidth + 10)},
|
||||||
{ duration: 200,
|
{ duration: 200,
|
||||||
|
@ -1976,11 +2016,11 @@ $(document).ready(function(){
|
||||||
var panning = false;
|
var panning = false;
|
||||||
var menuOut = false;
|
var menuOut = false;
|
||||||
|
|
||||||
$('.drag-target').on('click', function(){
|
dragTarget.on('click', function(){
|
||||||
removeMenu();
|
removeMenu();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.drag-target').hammer({
|
dragTarget.hammer({
|
||||||
prevent_default: false
|
prevent_default: false
|
||||||
}).bind('pan', function(e) {
|
}).bind('pan', function(e) {
|
||||||
|
|
||||||
|
@ -2059,7 +2099,7 @@ $(document).ready(function(){
|
||||||
if ((menuOut && velocityX <= 0.3) || velocityX < -0.5) {
|
if ((menuOut && velocityX <= 0.3) || velocityX < -0.5) {
|
||||||
menu_id.velocity({left: 0}, {duration: 300, queue: false, easing: 'easeOutQuad'});
|
menu_id.velocity({left: 0}, {duration: 300, queue: false, easing: 'easeOutQuad'});
|
||||||
$('#sidenav-overlay').velocity({opacity: 1 }, {duration: 50, queue: false, easing: 'easeOutQuad'});
|
$('#sidenav-overlay').velocity({opacity: 1 }, {duration: 50, queue: false, easing: 'easeOutQuad'});
|
||||||
$('.drag-target').css({width: '50%', right: 0, left: ''});
|
dragTarget.css({width: '50%', right: 0, left: ''});
|
||||||
}
|
}
|
||||||
else if (!menuOut || velocityX > 0.3) {
|
else if (!menuOut || velocityX > 0.3) {
|
||||||
// Enable Scrolling
|
// Enable Scrolling
|
||||||
|
@ -2070,14 +2110,14 @@ $(document).ready(function(){
|
||||||
complete: function () {
|
complete: function () {
|
||||||
$(this).remove();
|
$(this).remove();
|
||||||
}});
|
}});
|
||||||
$('.drag-target').css({width: '10px', right: '', left: 0});
|
dragTarget.css({width: '10px', right: '', left: 0});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if ((menuOut && velocityX >= -0.3) || velocityX > 0.5) {
|
if ((menuOut && velocityX >= -0.3) || velocityX > 0.5) {
|
||||||
menu_id.velocity({right: 0}, {duration: 300, queue: false, easing: 'easeOutQuad'});
|
menu_id.velocity({right: 0}, {duration: 300, queue: false, easing: 'easeOutQuad'});
|
||||||
$('#sidenav-overlay').velocity({opacity: 1 }, {duration: 50, queue: false, easing: 'easeOutQuad'});
|
$('#sidenav-overlay').velocity({opacity: 1 }, {duration: 50, queue: false, easing: 'easeOutQuad'});
|
||||||
$('.drag-target').css({width: '50%', right: '', left: 0});
|
dragTarget.css({width: '50%', right: '', left: 0});
|
||||||
}
|
}
|
||||||
else if (!menuOut || velocityX < -0.3) {
|
else if (!menuOut || velocityX < -0.3) {
|
||||||
// Enable Scrolling
|
// Enable Scrolling
|
||||||
|
@ -2088,7 +2128,7 @@ $(document).ready(function(){
|
||||||
complete: function () {
|
complete: function () {
|
||||||
$(this).remove();
|
$(this).remove();
|
||||||
}});
|
}});
|
||||||
$('.drag-target').css({width: '10px', right: 0, left: ''});
|
dragTarget.css({width: '10px', right: 0, left: ''});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2105,13 +2145,15 @@ $(document).ready(function(){
|
||||||
|
|
||||||
// Disable Scrolling
|
// Disable Scrolling
|
||||||
$('body').css('overflow', 'hidden');
|
$('body').css('overflow', 'hidden');
|
||||||
|
// Push current drag target on top of DOM tree
|
||||||
|
$('body').append(dragTarget);
|
||||||
|
|
||||||
if (options.edge === 'left') {
|
if (options.edge === 'left') {
|
||||||
$('.drag-target').css({width: '50%', right: 0, left: ''});
|
dragTarget.css({width: '50%', right: 0, left: ''});
|
||||||
menu_id.velocity({left: 0}, {duration: 300, queue: false, easing: 'easeOutQuad'});
|
menu_id.velocity({left: 0}, {duration: 300, queue: false, easing: 'easeOutQuad'});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$('.drag-target').css({width: '50%', right: '', left: 0});
|
dragTarget.css({width: '50%', right: '', left: 0});
|
||||||
menu_id.velocity({right: 0}, {duration: 300, queue: false, easing: 'easeOutQuad'});
|
menu_id.velocity({right: 0}, {duration: 300, queue: false, easing: 'easeOutQuad'});
|
||||||
menu_id.css('left','');
|
menu_id.css('left','');
|
||||||
}
|
}
|
||||||
|
@ -2454,7 +2496,7 @@ $(document).ready(function(){
|
||||||
var input_selector = 'input[type=text], input[type=password], input[type=email], input[type=url], input[type=tel], input[type=number], input[type=search], textarea';
|
var input_selector = 'input[type=text], input[type=password], input[type=email], input[type=url], input[type=tel], input[type=number], input[type=search], textarea';
|
||||||
$(input_selector).each(function(index, element) {
|
$(input_selector).each(function(index, element) {
|
||||||
if ($(element).val().length > 0 || $(this).attr('placeholder') !== undefined || $(element)[0].validity.badInput === true) {
|
if ($(element).val().length > 0 || $(this).attr('placeholder') !== undefined || $(element)[0].validity.badInput === true) {
|
||||||
$(this).siblings('label, i').addClass('active');
|
$(this).siblings('label').addClass('active');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$(this).siblings('label, i').removeClass('active');
|
$(this).siblings('label, i').removeClass('active');
|
||||||
|
@ -2471,7 +2513,7 @@ $(document).ready(function(){
|
||||||
// Add active if form auto complete
|
// Add active if form auto complete
|
||||||
$(document).on('change', input_selector, function () {
|
$(document).on('change', input_selector, function () {
|
||||||
if($(this).val().length !== 0 || $(this).attr('placeholder') !== undefined) {
|
if($(this).val().length !== 0 || $(this).attr('placeholder') !== undefined) {
|
||||||
$(this).siblings('label, i').addClass('active');
|
$(this).siblings('label').addClass('active');
|
||||||
}
|
}
|
||||||
validate_field($(this));
|
validate_field($(this));
|
||||||
});
|
});
|
||||||
|
@ -2510,10 +2552,14 @@ $(document).ready(function(){
|
||||||
if ($inputElement.val().length === 0 && $inputElement[0].validity.badInput !== true && $inputElement.attr('placeholder') === undefined) {
|
if ($inputElement.val().length === 0 && $inputElement[0].validity.badInput !== true && $inputElement.attr('placeholder') === undefined) {
|
||||||
$inputElement.siblings('label, i').removeClass('active');
|
$inputElement.siblings('label, i').removeClass('active');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($inputElement.val().length === 0 && $inputElement[0].validity.badInput !== true && $inputElement.attr('placeholder') !== undefined) {
|
||||||
|
$inputElement.siblings('i').removeClass('active');
|
||||||
|
}
|
||||||
validate_field($inputElement);
|
validate_field($inputElement);
|
||||||
});
|
});
|
||||||
|
|
||||||
validate_field = function(object) {
|
window.validate_field = function(object) {
|
||||||
var hasLength = object.attr('length') !== undefined;
|
var hasLength = object.attr('length') !== undefined;
|
||||||
var lenAttr = parseInt(object.attr('length'));
|
var lenAttr = parseInt(object.attr('length'));
|
||||||
var len = object.val().length;
|
var len = object.val().length;
|
||||||
|
@ -2527,7 +2573,7 @@ $(document).ready(function(){
|
||||||
else {
|
else {
|
||||||
if (object.hasClass('validate')) {
|
if (object.hasClass('validate')) {
|
||||||
// Check for character counter attributes
|
// Check for character counter attributes
|
||||||
if ((object.is(':valid') && hasLength && (len < lenAttr)) || (object.is(':valid') && !hasLength)) {
|
if ((object.is(':valid') && hasLength && (len <= lenAttr)) || (object.is(':valid') && !hasLength)) {
|
||||||
object.removeClass('invalid');
|
object.removeClass('invalid');
|
||||||
object.addClass('valid');
|
object.addClass('valid');
|
||||||
}
|
}
|
||||||
|
@ -2590,20 +2636,24 @@ $(document).ready(function(){
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('body').on('keyup keydown', text_area_selector, function () {
|
$('body').on('keyup keydown autoresize', text_area_selector, function () {
|
||||||
textareaAutoResize($(this));
|
textareaAutoResize($(this));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// File Input Path
|
// File Input Path
|
||||||
$('.file-field').each(function() {
|
|
||||||
var path_input = $(this).find('input.file-path');
|
|
||||||
$(this).find('input[type="file"]').change(function () {
|
|
||||||
path_input.val($(this)[0].files[0].name);
|
|
||||||
path_input.trigger('change');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
|
$(document).on('change', '.file-field input[type="file"]', function () {
|
||||||
|
var file_field = $(this).closest('.file-field');
|
||||||
|
var path_input = file_field.find('input.file-path');
|
||||||
|
var files = $(this)[0].files;
|
||||||
|
var file_names = [];
|
||||||
|
for (var i = 0; i < files.length; i++) {
|
||||||
|
file_names.push(files[i].name);
|
||||||
|
}
|
||||||
|
path_input.val(file_names.join(", "));
|
||||||
|
path_input.trigger('change');
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
/****************
|
/****************
|
||||||
|
@ -2625,7 +2675,7 @@ $(document).ready(function(){
|
||||||
thumb.find('.value').html($(this).val());
|
thumb.find('.value').html($(this).val());
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('mousedown touchstart', range_type, function(e) {
|
$(document).on('input mousedown touchstart', range_type, function(e) {
|
||||||
var thumb = $(this).siblings('.thumb');
|
var thumb = $(this).siblings('.thumb');
|
||||||
|
|
||||||
// If thumb indicator does not exist yet, create it
|
// If thumb indicator does not exist yet, create it
|
||||||
|
@ -2691,9 +2741,8 @@ $(document).ready(function(){
|
||||||
left = width;
|
left = width;
|
||||||
}
|
}
|
||||||
thumb.addClass('active').css('left', left);
|
thumb.addClass('active').css('left', left);
|
||||||
|
thumb.find('.value').html(thumb.siblings(range_type).val());
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('mouseout touchleave', range_wrapper, function() {
|
$(document).on('mouseout touchleave', range_wrapper, function() {
|
||||||
|
@ -2725,7 +2774,7 @@ $(document).ready(function(){
|
||||||
// Tear down structure if Select needs to be rebuilt
|
// Tear down structure if Select needs to be rebuilt
|
||||||
var lastID = $select.data('select-id');
|
var lastID = $select.data('select-id');
|
||||||
if (lastID) {
|
if (lastID) {
|
||||||
$select.parent().find('i').remove();
|
$select.parent().find('span.caret').remove();
|
||||||
$select.parent().find('input').remove();
|
$select.parent().find('input').remove();
|
||||||
|
|
||||||
$select.unwrap();
|
$select.unwrap();
|
||||||
|
@ -2783,7 +2832,10 @@ $(document).ready(function(){
|
||||||
if ( $select.is(':disabled') )
|
if ( $select.is(':disabled') )
|
||||||
dropdownIcon.addClass('disabled');
|
dropdownIcon.addClass('disabled');
|
||||||
|
|
||||||
var $newSelect = $('<input type="text" class="select-dropdown" readonly="true" ' + (($select.is(':disabled')) ? 'disabled' : '') + ' data-activates="select-options-' + uniqueID +'" value="'+ label.html() +'"/>');
|
// escape double quotes
|
||||||
|
var sanitizedLabelHtml = label.html().replace(/"/g, '"');
|
||||||
|
|
||||||
|
var $newSelect = $('<input type="text" class="select-dropdown" readonly="true" ' + (($select.is(':disabled')) ? 'disabled' : '') + ' data-activates="select-options-' + uniqueID +'" value="'+ sanitizedLabelHtml +'"/>');
|
||||||
$select.before($newSelect);
|
$select.before($newSelect);
|
||||||
$newSelect.before(dropdownIcon);
|
$newSelect.before(dropdownIcon);
|
||||||
|
|
||||||
|
@ -3204,7 +3256,7 @@ $(document).ready(function(){
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
$(document).on('click.card', '.card', function (e) {
|
$(document).on('click.card', '.card', function (e) {
|
||||||
if ($(this).find('.card-reveal').length) {
|
if ($(this).find('> .card-reveal').length) {
|
||||||
if ($(e.target).is($('.card-reveal .card-title')) || $(e.target).is($('.card-reveal .card-title i'))) {
|
if ($(e.target).is($('.card-reveal .card-title')) || $(e.target).is($('.card-reveal .card-title i'))) {
|
||||||
// Make Reveal animate down and display none
|
// Make Reveal animate down and display none
|
||||||
$(this).find('.card-reveal').velocity(
|
$(this).find('.card-reveal').velocity(
|
||||||
|
@ -3225,6 +3277,14 @@ $(document).ready(function(){
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
}( jQuery ));;(function ($) {
|
||||||
|
$(document).ready(function() {
|
||||||
|
|
||||||
|
$(document).on('click.chip', '.chip .material-icons', function (e) {
|
||||||
|
$(this).parent().remove();
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}( jQuery ));;(function ($) {
|
}( jQuery ));;(function ($) {
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
@ -3530,7 +3590,7 @@ $(document).ready(function(){
|
||||||
|
|
||||||
var currentElement = document.querySelector(selector);
|
var currentElement = document.querySelector(selector);
|
||||||
if ( currentElement !== null) {
|
if ( currentElement !== null) {
|
||||||
var elementOffset = currentElement.getBoundingClientRect().top + document.body.scrollTop;
|
var elementOffset = currentElement.getBoundingClientRect().top + window.pageYOffset;
|
||||||
|
|
||||||
if (windowScroll > (elementOffset + offset)) {
|
if (windowScroll > (elementOffset + offset)) {
|
||||||
if (value.done !== true) {
|
if (value.done !== true) {
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue