Merge remote-tracking branch 'caliblur/master'

pull/783/head
Ozzieisaacs 6 years ago
commit 8e95636599

File diff suppressed because one or more lines are too long

@ -188,6 +188,7 @@ return $(this).text().replace(/^\s+|^\t+|\t+|\s+$/g, "");
// Move dropdown lists higher in dom, replace bootstrap toggle with own toggle.
$( 'ul[aria-labelledby="read-in-browser"]' ).insertBefore( '.blur-wrapper' ).addClass('readinbrowser-drop');
$( 'ul[aria-labelledby="send-to-kindle"]' ).insertBefore( '.blur-wrapper' ).addClass('sendtokindle-drop');
$( '.leramslist' ).insertBefore( '.blur-wrapper' );
$( 'ul[aria-labelledby="btnGroupDrop1"]' ).insertBefore( '.blur-wrapper' ).addClass('leramslist');
$( '#add-to-shelves' ).insertBefore( '.blur-wrapper' );
@ -199,6 +200,11 @@ return $(this).text().replace(/^\s+|^\t+|\t+|\s+$/g, "");
$('.downloadBtn' ).click( function() {
$( '.leramslist' ).toggle();
});
$('#sendbtn2' ).click( function() {
$( '.sendtokindle-drop' ).toggle();
});
$('div[aria-label="Add to shelves"]' ).click( function() {
$( '#add-to-shelves' ).toggle();
@ -225,6 +231,17 @@ return $(this).text().replace(/^\s+|^\t+|\t+|\s+$/g, "");
$( '.readinbrowser-drop' ).attr("style", "left: " + position + "px !important; right: auto; top: " + topPos + "px");
}
}
if ( $( '#sendbtn2' ).length > 0 ) {
position = $( '#sendbtn2' ).offset().left
if ( position + $( '.sendtokindle-drop' ).width() > $( window ).width() ) {
positionOff = position + $( '.sendtokindle-drop' ).width() - $( window ).width();
ribPosition = position - positionOff - 5
$( '.sendtokindle-drop' ).attr("style", "left: " + ribPosition + "px !important; right: auto; top: " + topPos + "px");
} else {
$( '.sendtokindle-drop' ).attr("style", "left: " + position + "px !important; right: auto; top: " + topPos + "px");
}
}
if ( $( '.downloadBtn' ).length > 0 ) {
@ -274,6 +291,7 @@ $( '.book-meta > .bookinfo > .rating' ).clone().insertBefore( '.book-meta > .des
$(document).mouseup(function (e) {
var container = new Array();
container.push($('ul[aria-labelledby="read-in-browser"]'));
container.push($('.sendtokindle-drop'));
container.push($('.leramslist'));
container.push($('#add-to-shelves'));
container.push($('.navbar-collapse.collapse.in'));
@ -509,7 +527,7 @@ $( '.profileDrop' ).attr({
$( '#btn-upload' ).attr({
'data-toggle': 'tooltip',
'title': $( '#btn-upload' ).text() , // 'Upload',
'title': $( '#btn-upload' ).parent().text() , // 'Upload',
'data-placement': 'bottom',
'data-viewport': '#main-nav' })
.addClass('upload-btn-tooltip');
@ -564,6 +582,13 @@ $( '#sendbtn' ).attr({
'data-viewport': '.btn-toolbar' })
.addClass('send-btn-tooltip');
$( '#sendbtn2' ).attr({
'data-toggle-two': 'tooltip',
'title': 'Send to Kindle',
'data-placement': 'bottom',
'data-viewport': '.btn-toolbar' })
.addClass('send-btn-tooltip');
$( '#read-in-browser' ).attr({
'data-toggle-two': 'tooltip',
'title': 'Read',

@ -45,7 +45,7 @@
<a href="{{url_for('send_to_kindle', book_id=entry.id, book_format=kindle_list[0]['format'], convert=kindle_list[0]['convert'])}}" id="sendbtn" class="btn btn-primary" role="button"><span class="glyphicon glyphicon-send"></span> {{kindle_list[0]['text']}}</a>
{% else %}
<div class="btn-group" role="group">
<button id="sendbtn" type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<button id="sendbtn2" type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="glyphicon glyphicon-send"></span>{{_('Send to Kindle')}}
<span class="caret"></span>
</button>

Loading…
Cancel
Save