Skip to content

Commit 2f90586

Browse files
committed
Fix tab resize on window resize
Fix tab resize on window resize
1 parent 07eb2dd commit 2f90586

3 files changed

Lines changed: 82 additions & 20 deletions

File tree

index.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,30 @@
400400

401401
});
402402

403+
<?php if(!isset($groupCount)): ?>
404+
405+
$(window).resize(function () {
406+
407+
if (/*_base.lastWindowHeight !== $(window).height() ||*/ _base.lastWindowWidth !== $(window).width()) {
408+
409+
clearInterval(_base.resizeWindowIntervalId);
410+
411+
_base.resizeWindowIntervalId = setTimeout(function () {
412+
413+
_base.lastWindowHeight = $(window).height();
414+
415+
_base.lastWindowWidth = $(window).width();
416+
417+
418+
methods.checkWidth(_base);
419+
420+
}, _base.settings.responsiveDelay);
421+
}
422+
423+
});
424+
425+
<?php endif;?>
426+
403427
});
404428

405429

js/tabs.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

settings.php

Lines changed: 57 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,31 @@
1212

1313
}
1414

15-
function githubVersion (){
15+
$html = "https://github.com/causefx/iDashboard-PHP/releases/latest";
1616

17-
$html = "https://github.com/causefx/iDashboard-PHP/releases/latest";
18-
19-
$doc = new DOMDocument();
20-
21-
$doc->loadHTMLFile($html);
22-
23-
$xpath = new DomXpath($doc);
17+
$doc = new DOMDocument();
2418

25-
$version = $xpath->query('//span[@class="css-truncate-target"]')->item(0)->nodeValue;
26-
27-
if(!isset($version)){
19+
$doc->loadHTMLFile($html);
20+
21+
$xpath = new DomXpath($doc);
22+
23+
$githubChanges = $xpath->query('//div[@class="markdown-body"]//p')->item(0)->nodeValue;
24+
25+
$githubVersion = $xpath->query('//span[@class="css-truncate-target"]')->item(0)->nodeValue;
26+
27+
if(!isset($githubVersion)){
28+
29+
$githubVersion = "null";
2830

29-
$version = "null";
30-
}
31-
32-
return $version;
33-
3431
}
3532

36-
$githubVersion = githubVersion();
33+
if(!isset($githubChanges)){
3734

38-
$currentVersion = "1.07";
35+
$githubChanges = "null";
36+
37+
}
38+
39+
$currentVersion = "1.08";
3940

4041
foreach ($config as $keyname => $section) {
4142

@@ -63,7 +64,7 @@ function githubVersion (){
6364

6465
}elseif($currentVersion < $githubVersion){
6566

66-
$versionText = "New Version is out <a href=\"https://github.com/causefx/iDashboard-PHP/archive/master.zip\"> Download Here</a>";
67+
$versionText = "New Version is out <a class=\"btn btn-success btn-sm\" href=\"https://github.com/causefx/iDashboard-PHP/archive/master.zip\" role=\"button\">Download Now</a> <button type=\"button\" class=\"btn btn-success btn-sm\" data-toggle=\"modal\" data-target=\"#changes\">View Changes</button>";
6768
$versionIcon = "times";
6869
$versionColor = "#d9534f";
6970

@@ -514,6 +515,43 @@ function write_ini_file($content, $path) {
514515
</div>
515516

516517
</form>
518+
519+
<div class="modal fade" id="changes" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
520+
521+
<div class="modal-dialog" role="document">
522+
523+
<div class="modal-content">
524+
525+
<div class="modal-header">
526+
527+
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
528+
529+
<span aria-hidden="true">×</span>
530+
531+
</button>
532+
533+
<h4 class="modal-title" id="myModalLabel">New Changes/Fixes</h4>
534+
535+
</div>
536+
537+
<div class="modal-body">
538+
539+
<?=$githubChanges;?>
540+
541+
</div>
542+
543+
<div class="modal-footer">
544+
545+
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
546+
547+
548+
</div>
549+
550+
</div>
551+
552+
</div>
553+
554+
</div>
517555

518556
<script type="text/javascript" src="https://code.jquery.com/jquery-1.4.3.min.js"></script>
519557

0 commit comments

Comments
 (0)