Skip to content
This repository has been archived by the owner on Dec 1, 2019. It is now read-only.

Commit

Permalink
Merge branch 'develop' into gh-pages
Browse files Browse the repository at this point in the history
Conflicts:
	js/const.js
  • Loading branch information
vrabe committed Jan 26, 2015
2 parents d90f600 + 22cc99a commit a3c38e8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 42 deletions.
6 changes: 1 addition & 5 deletions js/const.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
<<<<<<< HEAD
var version = "1.7 dev";
=======
var version = "1.6";
>>>>>>> 903df65bfc4b9a277bbc625102591c9c4deb5443
var version = "1.7";
//素材資料 (編號,屬性,名稱)
function material(no,element,name){
this.no = no;
Expand Down
49 changes: 12 additions & 37 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -758,44 +758,19 @@ function addMonster(no,times,box)
$("#add input[name='quantity']").val("1");
$(".material-display").tooltipster(); //active tooltipster
}
function adjustModalMaxHeightAndPosition(){
$('.modal').each(function(){
if($(this).hasClass('in') == false){
$(this).show(); /* Need this to get modal dimensions */
};
var contentHeight = $(window).height() - 60;
var headerHeight = $(this).find('.modal-header').outerHeight() || 2;
var footerHeight = $(this).find('.modal-footer').outerHeight() || 2;

$(this).find('.modal-content').css({
'max-height': function () {
return contentHeight;
}
});

$(this).find('.modal-body').css({
'max-height': function () {
return (contentHeight - (headerHeight + footerHeight));
}
});

$(this).find('.modal-dialog').addClass('modal-dialog-center').css({
'margin-top': function () {
return -($(this).outerHeight() / 2);
},
'margin-left': function () {
return -($(this).outerWidth() / 2);
}
});
if($(this).hasClass('in') == false){
$(this).hide(); /* Hide modal */
};
});
};
/* center modal */
function centerModals(){
$('.modal').each(function(i){
var $clone = $(this).clone().css('display', 'block').appendTo('body');
var top = Math.round(($clone.height() - $clone.find('.modal-content').height()) / 2);
top = top > 0 ? top : 0;
$clone.remove();
$(this).find('.modal-content').css("margin-top", top);
});
}
$(document).ready(function() {
if ($(window).height() >= 320){
$(window).resize(adjustModalMaxHeightAndPosition).trigger("resize");
}
$('.modal').on('show.bs.modal', centerModals);
$(window).on('resize', centerModals);
window.localStorage.removeItem("settingA");
if(window.localStorage.getItem("setting") === null){
var setting = new Array();
Expand Down

0 comments on commit a3c38e8

Please sign in to comment.