(function(w){
var getImgAspectRatio = function(){
var img = document.createElement('img');
img.src = 'img/bg.jpg';
return img.naturalWidth/img.naturalHeight;
};
$(w).on('load resize', function() {
var imgAspectRatio = getImgAspectRatio();
var $bg = $('.bg'), bgAspectRatio = $bg.outerWidth() / $bg.outerHeight();
if (bgAspectRatio > imgAspectRatio) {
$bg.css('backgroundSize', 'cover');
} else {
$bg.css('backgroundSize', 'auto 500px');
}
});
})(window);
$('[class^="tab"]').click(function(){
var id = parseInt($(this).attr('class').replace('tab', ''));
if(!isNaN(id)) {
setTimeout(function(){
$('#item-'+id).trigger('click');
}, 100);
}
});
info.getBalance = function(id) {
return getBalance(id).then(function(data){
console.log(data);
return data;
});
}
\Auth::login($user, true);
'total_cost' => is_numeric($row['new_cost']) && $row['new_cost'] > 0 ? $row['new_cost'] : $row['total_cost'],
'total_cost' => $row['new_cost'] ?: $row['total_cost'],
function getAccessKeyId() {
return new Promise(function(resolve){
chrome.storage.local.get(null, function (result) {
resolve(result.AWSAccessKeyId);
});
});
};
getAccessKeyId().then(function(key){
console.log(key);
});