mirror of
https://github.com/e107inc/e107.git
synced 2025-04-21 05:02:02 +02:00
JS callback function to check selector is valid or not. Missing LAN vars for prettyPhoto.
This commit is contained in:
parent
2cae5b9023
commit
c912c78efa
@ -116,6 +116,8 @@ define("LAN_EMAIL","Email address");
|
||||
define("LAN_WROTE", "wrote"); // as in John wrote.." ";
|
||||
define("LAN_RE_ORDER", "Re-order");
|
||||
define("LAN_RELATED", "Related");
|
||||
define("LAN_CLOSE", "Close");
|
||||
define("LAN_EXPAND", "Expand");
|
||||
|
||||
define("LAN_ENTER_USRNAME_EMAIL", "Please enter your username or email"); // admin php hover field admin name
|
||||
define("LAN_PWD_REQUIRED", "Password is required"); // admin php hover field admin password
|
||||
|
@ -251,6 +251,24 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Check if the selector is valid.
|
||||
*
|
||||
* @param selector
|
||||
* @returns {boolean}
|
||||
*/
|
||||
e107.callbacks.isValidSelector = function (selector)
|
||||
{
|
||||
try
|
||||
{
|
||||
var $element = $(selector);
|
||||
} catch(error)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
/**
|
||||
* Dynamic next/prev.
|
||||
*
|
||||
|
@ -23,7 +23,7 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
|
||||
e107.behaviors.initializeSmoothScrolling = {
|
||||
attach: function (context, settings)
|
||||
{
|
||||
if(window.location.hash)
|
||||
if(window.location.hash && e107.callbacks.isValidSelector(window.location.hash))
|
||||
{
|
||||
$(context).find('body').once('initialize-smooth-scrolling').each(function ()
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user