Move JS to main.js
This commit is contained in:
parent
133b061179
commit
a49e66889d
|
@ -28,15 +28,3 @@
|
|||
$this->Js->get('#monitors');
|
||||
$this->Js->sortable(array('complete' => '$.post("/monitors/reorder", $("#monitors").sortable("serialize"))',));
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(window).load(function () {
|
||||
$(".livestream_resize").each(function(index, element){
|
||||
if($(element).attr('src').indexOf('scale=') >= 0){
|
||||
var newScale = Math.ceil(($(element).width() / $(element).attr('width')) * 100);
|
||||
var src = $(element).attr('src').replace('scale=100', 'scale='+newScale);
|
||||
$(element).attr('src', src);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
|
@ -193,6 +193,17 @@ $(document).ready(function() {
|
|||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$(".livestream_resize").each(function(index, element){
|
||||
if($(element).attr('src').indexOf('scale=') >= 0){
|
||||
var newScale = Math.ceil(($(element).width() / $(element).attr('width')) * 100);
|
||||
var src = $(element).attr('src').replace('scale=100', 'scale='+newScale);
|
||||
$(element).attr('src', src);
|
||||
console.log("resized");
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
|
||||
// Monitors //
|
||||
|
|
Loading…
Reference in New Issue