Browse Source

Updates sticky module, search module is now css variabalized

pull/912/head
jlukic 10 years ago
parent
commit
36804897f8
3 changed files with 29 additions and 16 deletions
  1. 13
      src/definitions/modules/popup.js
  2. 5
      src/definitions/modules/search.js
  3. 27
      src/definitions/modules/sticky.js

13
src/definitions/modules/popup.js

@ -517,6 +517,9 @@ $.fn.popup = function(parameters) {
};
break;
}
if(positioning === undefined) {
module.error(error.invalidPosition);
}
// tentatively place on stage
$popup
.css(positioning)
@ -608,7 +611,6 @@ $.fn.popup = function(parameters) {
},
setting: function(name, value) {
module.debug('Changing setting', name, value);
if( $.isPlainObject(name) ) {
$.extend(true, settings, name);
}
@ -786,7 +788,7 @@ $.fn.popup = function(parameters) {
$.fn.popup.settings = {
name : 'Popup',
debug : true,
debug : false,
verbose : true,
performance : true,
namespace : 'popup',
@ -819,9 +821,10 @@ $.fn.popup.settings = {
maxSearchDepth : 10,
error: {
content : 'Your popup has no content specified',
method : 'The method you called is not defined.',
recursion : 'Popup attempted to reposition element to fit, but could not find an adequate position.'
content : 'Your popup has no content specified',
invalidPosition : 'The position you specified is not a valid position',
method : 'The method you called is not defined.',
recursion : 'Popup attempted to reposition element to fit, but could not find an adequate position.'
},
metadata: {

5
src/definitions/modules/search.js

@ -422,7 +422,6 @@ $.fn.search = function(parameters) {
},
setting: function(name, value) {
module.debug('Changing setting', name, value);
if( $.isPlainObject(name) ) {
$.extend(true, settings, name);
}
@ -708,7 +707,7 @@ $.fn.search.settings = {
+ '</div>'
;
}
html += '<div class="info">';
html += '<div class="content">';
if(result.price !== undefined) {
html+= '<div class="price">' + result.price + '</div>';
}
@ -754,7 +753,7 @@ $.fn.search.settings = {
+ '</div>'
;
}
html += '<div class="info">';
html += '<div class="content">';
if(result.price !== undefined) {
html+= '<div class="price">' + result.price + '</div>';
}

27
src/definitions/modules/sticky.js

@ -58,7 +58,6 @@ $.fn.sticky = function(parameters) {
module = {
initialize: function() {
module.verbose('Initializing sticky', settings);
if(settings.context) {
$context = $(settings.context);
@ -67,6 +66,13 @@ $.fn.sticky = function(parameters) {
$context = $container;
}
if($context.size() === 0) {
module.error(error.invalidContext, settings.context, $module);
return;
}
module.verbose('Initializing sticky', settings, $container);
$window
.on('resize' + eventNamespace, module.event.resize)
.on('scroll' + eventNamespace, module.event.scroll)
@ -109,10 +115,13 @@ $.fn.sticky = function(parameters) {
}
},
refresh: function() {
refresh: function(hardRefresh) {
module.reset();
module.save.positions();
$.proxy(settings.onReposition, element)();
if(hardRefresh) {
$container = $module.offsetParent();
}
},
save: {
@ -204,8 +213,10 @@ $.fn.sticky = function(parameters) {
set: {
containerSize: function() {
if($module.is(':visible') && $container.get(0).tagName === 'HTML') {
module.error(error.container, $container.get(0), $container.get(0).tagName);
if($container.get(0).tagName === 'HTML') {
if($module.is(':visible')) {
module.error(error.container, $container.get(0).tagName, $module);
}
}
else {
module.debug('Settings container size', module.cache.context.height);
@ -429,7 +440,6 @@ $.fn.sticky = function(parameters) {
},
setting: function(name, value) {
module.debug('Changing setting', name, value);
if( $.isPlainObject(name) ) {
$.extend(true, settings, name);
}
@ -610,7 +620,7 @@ $.fn.sticky.settings = {
namespace : 'sticky',
verbose : true,
debug : true,
debug : false,
performance : true,
pushing : false,
@ -626,8 +636,9 @@ $.fn.sticky.settings = {
onBottom : function(){},
error : {
container: 'Sticky element must be inside a relative container',
method : 'The method you called is not defined.'
container : 'Sticky element must be inside a relative container',
method : 'The method you called is not defined.',
invalidContext : 'Context specified does not exist'
},
className : {

Loading…
Cancel
Save