var $ppm = $('.ppm[data-toggle="popover');
var $error = $('.has-error[data-toggle="popover"]');
var $issue = $('.issue-block [data-toggle="popover"]');
var prefix,pchedt,pche,cppm,pcib;
if (width = 768 && width = 992 && width = 1200 && width = 1600) {
prefix = 'xlg';
}
cppm = getPosition($ppm,prefix);
pche = pchedt = getPosition($error,prefix);
pcib = getPosition($issue,prefix);
/**
* Возвращает позицию по селектору
*
* @param jQuery $selector
* @param string prefix
*
* @return string
*/
function getPosition ($selector,prefix) {
if ($selector.hasClass(prefix+'-bottom')) {
return 'bottom';
}
if ($selector.hasClass(prefix+'-top')) {
return 'top';
}
if ($selector.hasClass(prefix+'-left')) {
return 'left';
}
if ($selector.hasClass(prefix+'-right')) {
return 'right';
}
return '';
}