Commit a0345423 authored by Dave Lane's avatar Dave Lane
Browse files

enhancing touch behaviour to close popup if tapped

parent 1ab5c27e
...@@ -68,10 +68,12 @@ abstract class BFFFinder extends BFFFeed { ...@@ -68,10 +68,12 @@ abstract class BFFFinder extends BFFFeed {
if ($this->find_feed_in_page($url)) { if ($this->find_feed_in_page($url)) {
$this->log('found a feed reference in the page content!'); $this->log('found a feed reference in the page content!');
// look for a feed referenced in the page // look for a feed referenced in the page
$this->response['valid_url'] = $url;
$succeeded = true; $succeeded = true;
} else if ($this->find_feed_in_usual_places($url)) { } else if ($this->find_feed_in_usual_places($url)) {
// look for feeds in the normal places // look for feeds in the normal places
$this->log('looking for a feed in the usual places'); $this->log('looking for a feed in the usual places');
$this->response['valid_url'] = $url;
$succeeded = true; $succeeded = true;
} else { } else {
$this->log('failed to find a feed at: '. $url); $this->log('failed to find a feed at: '. $url);
......
...@@ -150,9 +150,10 @@ jQuery(document).ready(function() { ...@@ -150,9 +150,10 @@ jQuery(document).ready(function() {
* initialise jquery tooltips with custom functionality * initialise jquery tooltips with custom functionality
* credit for this: https://gist.github.com/csasbach/867744 * credit for this: https://gist.github.com/csasbach/867744
*/ */
var tooltip = '.bff-tooltip'; // trigger for popup content
var popup = 'bff-popup'; // the actual popup class
function enable_tooltips() { function enable_tooltips() {
var tooltip = '.bff-tooltip'; // trigger for popup content
var popup = 'bff-popup'; // the actual popup class
// popup display offsets // popup display offsets
var voffset = 6; var voffset = 6;
var hoffset = 6; var hoffset = 6;
...@@ -181,6 +182,7 @@ jQuery(document).ready(function() { ...@@ -181,6 +182,7 @@ jQuery(document).ready(function() {
var top = $(this).position().top-voffset; var top = $(this).position().top-voffset;
$(this).next().css('left',left); $(this).next().css('left',left);
$(this).next().css('top',top); $(this).next().css('top',top);
enable_popup();
}); });
// manage clicks, e.g. from touch devices // manage clicks, e.g. from touch devices
$(tooltip).click(function() { $(tooltip).click(function() {
...@@ -196,9 +198,19 @@ jQuery(document).ready(function() { ...@@ -196,9 +198,19 @@ jQuery(document).ready(function() {
console.log('mouseout'); console.log('mouseout');
$(this).next('.'+popup).remove(); $(this).next('.'+popup).remove();
}); });
});
}
function enable_popup() {
console.log('enabling popup');
$('.'+popup).each(function() {
// if the user explicitly clicks on a popup
$('.'+popup).click(function() {
console.log('click on popup');
$(this).remove();
});
}); });
} }
/* /*
* end tooltip stuff * end tooltip stuff
*/ */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment