Browse Source

Rlsnotes and build

pull/2300/head
jlukic 9 years ago
parent
commit
5bd45a2fcf
5 changed files with 139 additions and 135 deletions
  1. 2
      RELEASE-NOTES.md
  2. 132
      dist/components/visibility.js
  3. 2
      dist/components/visibility.min.js
  4. 132
      dist/semantic.js
  5. 6
      dist/semantic.min.js

2
RELEASE-NOTES.md

@ -102,7 +102,7 @@
- **Table** - Added `vertical alignment` variations to `ui table`
- **Visibility/Sticky** - Visibility and sticky now refresh automatically after page content loading to deal with changes in position from images loading
- **Visibility/Sticky** - Visibility now uses pub/sub pattern to greatly improve scroll performance when attaching multiple events
- **Visibility** - Visibility inc
- **Visibility** - Visibility `image` will now wait to lazy load images that are *above* the current screen position, not just below.
**Bugs**
- **All Modules** - Performance logging now delays 500ms instead of 100ms for console logging to ensure all logs are captured in one group

132
dist/components/visibility.js

@ -159,38 +159,6 @@ $.fn.visibility = function(parameters) {
.on('scroll' + eventNamespace, module.event.scroll)
.on('scrollchange' + eventNamespace, module.event.scrollchange)
;
},
imageLoad: function() {
var
$images = $module.find('img'),
imageCount = $images.length,
index = imageCount,
loadedCount = 0,
images = [],
cache = [],
cacheImage = document.createElement('img'),
handleLoad = function() {
loadedCount++;
if(loadedCount >= imageCount) {
module.debug('Images finished loading inside element, refreshing position');
module.refresh();
}
}
;
if(imageCount > 0) {
$images
.each(function() {
images.push( $(this).attr('src') );
})
;
while(index--) {
cacheImage = document.createElement('img');
cacheImage.onload = handleLoad;
cacheImage.onerror = handleLoad;
cacheImage.src = images[index];
cache.push(cacheImage);
}
}
}
},
@ -291,32 +259,17 @@ $.fn.visibility = function(parameters) {
module.debug('Setting up fixed');
settings.once = false;
settings.observeChanges = false;
settings.refreshOnLoad = false;
settings.initialCheck = true;
settings.refreshOnLoad = true;
if(!parameters.transition) {
settings.transition = false;
}
$placeholder = $module
.clone(false)
.css('display', 'none')
.addClass(className.placeholder)
.insertAfter($module)
;
module.create.placeholder();
module.debug('Added placeholder', $placeholder);
settings.onTopPassed = function() {
module.debug('Element passed, adding fixed position', $module);
$placeholder
.css('display', 'block')
.css('visibility', 'hidden')
;
$module
.addClass(className.fixed)
.css({
position : 'fixed',
top : settings.offset + 'px',
left : 'auto',
zIndex : '1'
})
;
module.show.placeholder();
module.set.fixed();
if(settings.transition) {
if($.fn.transition !== undefined) {
$module.transition(settings.transition, settings.duration);
@ -325,24 +278,56 @@ $.fn.visibility = function(parameters) {
};
settings.onTopPassedReverse = function() {
module.debug('Element returned to position, removing fixed', $module);
$placeholder
.css('display', 'none')
.css('visibility', '')
;
$module
.removeClass(className.fixed)
.css({
position : '',
top : '',
left : '',
zIndex : ''
})
;
module.hide.placeholder();
module.remove.fixed();
};
}
},
create: {
placeholder: function() {
module.verbose('Creating fixed position placeholder');
$placeholder = $module
.clone(false)
.css('display', 'none')
.addClass(className.placeholder)
.insertAfter($module)
;
}
},
show: {
placeholder: function() {
module.verbose('Showing placeholder');
$placeholder
.css('display', 'block')
.css('visibility', 'hidden')
;
}
},
hide: {
placeholder: function() {
module.verbose('Hiding placeholder');
$placeholder
.css('display', 'none')
.css('visibility', '')
;
}
},
set: {
fixed: function() {
module.verbose('Setting element to fixed position');
$module
.addClass(className.fixed)
.css({
position : 'fixed',
top : settings.offset + 'px',
left : 'auto',
zIndex : '1'
})
;
},
image: function(src) {
$module
.attr('src', src)
@ -384,6 +369,10 @@ $.fn.visibility = function(parameters) {
refresh: function() {
module.debug('Refreshing constants (width/height)');
if(settings.type == 'fixed') {
module.remove.fixed();
module.remove.occurred();
}
module.reset();
module.save.position();
module.checkVisibility();
@ -743,6 +732,18 @@ $.fn.visibility = function(parameters) {
},
remove: {
fixed: function() {
module.debug('Removing fixed position');
$module
.removeClass(className.fixed)
.css({
position : '',
top : '',
left : '',
zIndex : ''
})
;
},
occurred: function(callback) {
if(callback) {
var
@ -809,6 +810,7 @@ $.fn.visibility = function(parameters) {
element.height = $module.outerHeight();
// store
module.cache.element = element;
console.log(element.offset, $module);
return element;
},
elementCalculations: function() {

2
dist/components/visibility.min.js
File diff suppressed because it is too large
View File

132
dist/semantic.js

@ -18827,38 +18827,6 @@ $.fn.visibility = function(parameters) {
.on('scroll' + eventNamespace, module.event.scroll)
.on('scrollchange' + eventNamespace, module.event.scrollchange)
;
},
imageLoad: function() {
var
$images = $module.find('img'),
imageCount = $images.length,
index = imageCount,
loadedCount = 0,
images = [],
cache = [],
cacheImage = document.createElement('img'),
handleLoad = function() {
loadedCount++;
if(loadedCount >= imageCount) {
module.debug('Images finished loading inside element, refreshing position');
module.refresh();
}
}
;
if(imageCount > 0) {
$images
.each(function() {
images.push( $(this).attr('src') );
})
;
while(index--) {
cacheImage = document.createElement('img');
cacheImage.onload = handleLoad;
cacheImage.onerror = handleLoad;
cacheImage.src = images[index];
cache.push(cacheImage);
}
}
}
},
@ -18959,32 +18927,17 @@ $.fn.visibility = function(parameters) {
module.debug('Setting up fixed');
settings.once = false;
settings.observeChanges = false;
settings.refreshOnLoad = false;
settings.initialCheck = true;
settings.refreshOnLoad = true;
if(!parameters.transition) {
settings.transition = false;
}
$placeholder = $module
.clone(false)
.css('display', 'none')
.addClass(className.placeholder)
.insertAfter($module)
;
module.create.placeholder();
module.debug('Added placeholder', $placeholder);
settings.onTopPassed = function() {
module.debug('Element passed, adding fixed position', $module);
$placeholder
.css('display', 'block')
.css('visibility', 'hidden')
;
$module
.addClass(className.fixed)
.css({
position : 'fixed',
top : settings.offset + 'px',
left : 'auto',
zIndex : '1'
})
;
module.show.placeholder();
module.set.fixed();
if(settings.transition) {
if($.fn.transition !== undefined) {
$module.transition(settings.transition, settings.duration);
@ -18993,24 +18946,56 @@ $.fn.visibility = function(parameters) {
};
settings.onTopPassedReverse = function() {
module.debug('Element returned to position, removing fixed', $module);
$placeholder
.css('display', 'none')
.css('visibility', '')
;
$module
.removeClass(className.fixed)
.css({
position : '',
top : '',
left : '',
zIndex : ''
})
;
module.hide.placeholder();
module.remove.fixed();
};
}
},
create: {
placeholder: function() {
module.verbose('Creating fixed position placeholder');
$placeholder = $module
.clone(false)
.css('display', 'none')
.addClass(className.placeholder)
.insertAfter($module)
;
}
},
show: {
placeholder: function() {
module.verbose('Showing placeholder');
$placeholder
.css('display', 'block')
.css('visibility', 'hidden')
;
}
},
hide: {
placeholder: function() {
module.verbose('Hiding placeholder');
$placeholder
.css('display', 'none')
.css('visibility', '')
;
}
},
set: {
fixed: function() {
module.verbose('Setting element to fixed position');
$module
.addClass(className.fixed)
.css({
position : 'fixed',
top : settings.offset + 'px',
left : 'auto',
zIndex : '1'
})
;
},
image: function(src) {
$module
.attr('src', src)
@ -19052,6 +19037,10 @@ $.fn.visibility = function(parameters) {
refresh: function() {
module.debug('Refreshing constants (width/height)');
if(settings.type == 'fixed') {
module.remove.fixed();
module.remove.occurred();
}
module.reset();
module.save.position();
module.checkVisibility();
@ -19411,6 +19400,18 @@ $.fn.visibility = function(parameters) {
},
remove: {
fixed: function() {
module.debug('Removing fixed position');
$module
.removeClass(className.fixed)
.css({
position : '',
top : '',
left : '',
zIndex : ''
})
;
},
occurred: function(callback) {
if(callback) {
var
@ -19477,6 +19478,7 @@ $.fn.visibility = function(parameters) {
element.height = $module.outerHeight();
// store
module.cache.element = element;
console.log(element.offset, $module);
return element;
},
elementCalculations: function() {

6
dist/semantic.min.js
File diff suppressed because it is too large
View File

Loading…
Cancel
Save