Skip to content

Commit

Permalink
fix: fix caption setting issue
Browse files Browse the repository at this point in the history
  • Loading branch information
nzbin committed Dec 24, 2019
1 parent 0c4cac0 commit dc216be
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 18 deletions.
9 changes: 2 additions & 7 deletions dist/jquery.magnify.js
Original file line number Diff line number Diff line change
Expand Up @@ -1004,9 +1004,7 @@ Magnify.prototype = {
});
},
setImgTitle: function (url) {
var title = this.groupData[this.groupIndex].title
? this.groupData[this.groupIndex].title
: getImageNameFromUrl(url);
var title = this.groupData[this.groupIndex].caption || getImageNameFromUrl(url);

this.$title.html(title);
},
Expand Down Expand Up @@ -2041,10 +2039,7 @@ var resizable = function (modal, stage, image, minWidth, minHeight) {
PUBLIC_VARS['isResizing'] = false;

// Remove resizable cursor
$('html,body,.magnify-modal,.magnify-stage,.magnify-button').css(
'cursor',
''
);
$('html, body, .magnify-modal, .magnify-stage, .magnify-button').css('cursor', '');

// Update image initial data
var scale = self.getImageScaleToStage($(stage).width(), $(stage).height());
Expand Down
2 changes: 1 addition & 1 deletion dist/jquery.magnify.min.js

Large diffs are not rendered by default.

9 changes: 2 additions & 7 deletions docs/js/jquery.magnify.js
Original file line number Diff line number Diff line change
Expand Up @@ -1004,9 +1004,7 @@ Magnify.prototype = {
});
},
setImgTitle: function (url) {
var title = this.groupData[this.groupIndex].title
? this.groupData[this.groupIndex].title
: getImageNameFromUrl(url);
var title = this.groupData[this.groupIndex].caption || getImageNameFromUrl(url);

this.$title.html(title);
},
Expand Down Expand Up @@ -2041,10 +2039,7 @@ var resizable = function (modal, stage, image, minWidth, minHeight) {
PUBLIC_VARS['isResizing'] = false;

// Remove resizable cursor
$('html,body,.magnify-modal,.magnify-stage,.magnify-button').css(
'cursor',
''
);
$('html, body, .magnify-modal, .magnify-stage, .magnify-button').css('cursor', '');

// Update image initial data
var scale = self.getImageScaleToStage($(stage).width(), $(stage).height());
Expand Down
4 changes: 1 addition & 3 deletions src/js/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -817,9 +817,7 @@ Magnify.prototype = {
});
},
setImgTitle: function (url) {
var title = this.groupData[this.groupIndex].title
? this.groupData[this.groupIndex].title
: getImageNameFromUrl(url);
var title = this.groupData[this.groupIndex].caption || getImageNameFromUrl(url);

this.$title.html(title);
},
Expand Down

0 comments on commit dc216be

Please sign in to comment.