Skip to content

Commit

Permalink
release: v1.4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
nzbin committed May 27, 2019
1 parent 593a368 commit c54aff4
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 60 deletions.
3 changes: 2 additions & 1 deletion dist/jquery.magnify.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* | | | | _ | \_/ | |\ |_| |_| | | |
* |__| |__|__| |__|\____/|_|__| \__|_____|__| |__|
*
* jquery.magnify - v1.4.2
* jquery.magnify - v1.4.3
* A jQuery plugin to view images just like in windows
* https://github.com/nzbin/magnify#readme
*
Expand Down Expand Up @@ -179,6 +179,7 @@
border-style: solid;
border-color: rgba(0, 0, 0, 0.5) rgba(0, 0, 0, 0.5) rgba(0, 0, 0, 0.5) rgba(255, 255, 255, 0.5);
border-radius: 100%;
vertical-align: middle;
-webkit-animation: magnifyLoading 1s infinite linear;
animation: magnifyLoading 1s infinite linear;
}
Expand Down
53 changes: 29 additions & 24 deletions dist/jquery.magnify.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* | | | | _ | \_/ | |\ |_| |_| | | |
* |__| |__|__| |__|\____/|_|__| \__|_____|__| |__|
*
* jquery.magnify - v1.4.2
* jquery.magnify - v1.4.3
* A jQuery plugin to view images just like in windows
* https://github.com/nzbin/magnify#readme
*
Expand Down Expand Up @@ -566,7 +566,7 @@ Magnify.prototype = {
}

},
_creatBtns: function (toolbar, btns) {
_createBtns: function (toolbar, btns) {

var btnsStr = '';

Expand All @@ -577,10 +577,10 @@ Magnify.prototype = {
return btnsStr;

},
_creatTitle: function () {
_createTitle: function () {
return (this.options.title ? '<div class="magnify-title"></div>' : '');
},
creatDOM: function () {
render: function () {

var btnsTpl = {
minimize: '<button class="magnify-button magnify-button-minimize" title="' +
Expand Down Expand Up @@ -634,16 +634,16 @@ Magnify.prototype = {
'<div class="magnify-modal">\
<div class="magnify-header">\
<div class="magnify-toolbar magnify-head-toolbar">' +
this._creatBtns(this.options.headToolbar, btnsTpl) + '\
this._createBtns(this.options.headToolbar, btnsTpl) + '\
</div>' +
this._creatTitle() + '\
this._createTitle() + '\
</div>\
<div class="magnify-stage">\
<img class="magnify-image" src="" alt="" />\
</div>\
<div class="magnify-footer">\
<div class="magnify-toolbar magnify-foot-toolbar">' +
this._creatBtns(this.options.footToolbar, btnsTpl) + '\
this._createBtns(this.options.footToolbar, btnsTpl) + '\
</div>\
</div>\
</div>';
Expand All @@ -654,7 +654,7 @@ Magnify.prototype = {
build: function () {

// Create magnify HTML string
var magnifyHTML = this.creatDOM();
var magnifyHTML = this.render();

// Make magnify HTML string to jQuery element
var $magnify = $(magnifyHTML);
Expand Down Expand Up @@ -930,37 +930,42 @@ Magnify.prototype = {
this.isRotated
);

// Remove class must when image setting end
this.$stage.removeClass('stage-ready');
this.$image.removeClass('image-ready');

// loader end
this.$magnify.find('.magnify-loader').remove();
// Just execute before image loaded
if(!this.imgLoaded){
// loader end
this.$magnify.find('.magnify-loader').remove();

// Remove class must when image setting end
this.$stage.removeClass('stage-ready');
this.$image.removeClass('image-ready');

// Add image init animation
if (this.options.initAnimation && !this.options.progressiveLoading) {
$image.fadeIn();
}

// Add image init animation
if (this.options.initAnimation && !this.options.progressiveLoading) {
$image.fadeIn();
this.imgLoaded = true;
}

},
loadImg: function (imgSrc, fn, err) {

var self = this;

var loaderHTML = '<div class="magnify-loader"></div>';
// Reset image
this.$image.removeAttr('style').attr('src', '');
this.isRotated = false;
this.rotateAngle = 0;

this.imgLoaded = false;

// loader start
this.$magnify.append(loaderHTML);
this.$magnify.append('<div class="magnify-loader"></div>');

// Add class before image loaded
this.$stage.addClass('stage-ready');
this.$image.addClass('image-ready');

// Reset image
this.$image.removeAttr('style').attr('src', '');
this.isRotated = false;
this.rotateAngle = 0;

if (this.options.initAnimation && !this.options.progressiveLoading) {
this.$image.hide();
}
Expand Down
4 changes: 2 additions & 2 deletions dist/jquery.magnify.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions dist/jquery.magnify.min.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion docs/css/jquery.magnify.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* | | | | _ | \_/ | |\ |_| |_| | | |
* |__| |__|__| |__|\____/|_|__| \__|_____|__| |__|
*
* jquery.magnify - v1.4.2
* jquery.magnify - v1.4.3
* A jQuery plugin to view images just like in windows
* https://github.com/nzbin/magnify#readme
*
Expand Down Expand Up @@ -179,6 +179,7 @@
border-style: solid;
border-color: rgba(0, 0, 0, 0.5) rgba(0, 0, 0, 0.5) rgba(0, 0, 0, 0.5) rgba(255, 255, 255, 0.5);
border-radius: 100%;
vertical-align: middle;
-webkit-animation: magnifyLoading 1s infinite linear;
animation: magnifyLoading 1s infinite linear;
}
Expand Down
Loading

0 comments on commit c54aff4

Please sign in to comment.