Merge pull request #26 from beatriceo/modal-fix
fixed issue where modal trigger broke navbar
This commit is contained in:
commit
b2182f0322
|
@ -16,10 +16,12 @@ let pcPeers = {}; // peer connection
|
||||||
let localstream;
|
let localstream;
|
||||||
|
|
||||||
window.onload = () => {
|
window.onload = () => {
|
||||||
currentUser = document.getElementById("current-user").innerHTML;
|
if (document.getElementById("current-user")) {
|
||||||
console.log(currentUser)
|
currentUser = document.getElementById("current-user").innerHTML;
|
||||||
localVideo = document.getElementById("local-video");
|
console.log(currentUser)
|
||||||
remoteVideoContainer = document.getElementById("remote-video-container");
|
localVideo = document.getElementById("local-video");
|
||||||
|
remoteVideoContainer = document.getElementById("remote-video-container");
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Ice Credentials
|
// Ice Credentials
|
||||||
|
@ -35,8 +37,10 @@ document.onreadystatechange = async () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
localstream = stream;
|
localstream = stream;
|
||||||
localVideo.srcObject = stream
|
if (localVideo) {
|
||||||
localVideo.muted = true
|
localVideo.srcObject = stream
|
||||||
|
localVideo.muted = true
|
||||||
|
}
|
||||||
} catch (e) { console.error(e); }
|
} catch (e) { console.error(e); }
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -67,7 +71,11 @@ document.onreadystatechange = async () => {
|
||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
// };
|
// };
|
||||||
const chatroomId = document.getElementById('chatroom-hook').dataset["chatroomId"]
|
|
||||||
|
if (document.getElementById('chatroom-hook')) {
|
||||||
|
const chatroomId = document.getElementById('chatroom-hook').dataset["chatroomId"]
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
const handleJoinSession = async () => {
|
const handleJoinSession = async () => {
|
||||||
App['chatroom' + chatroomId] = await App.cable.subscriptions.create({
|
App['chatroom' + chatroomId] = await App.cable.subscriptions.create({
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
|
||||||
|
const triggerModalEvent = () => {
|
||||||
|
const btn = document.getElementById("modalTrigger");
|
||||||
|
const modal = document.getElementById("myModal");
|
||||||
|
|
||||||
|
btn.addEventListener('click', function(event) {
|
||||||
|
$('#myModal').modal('show');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export { triggerModalEvent }
|
|
@ -1,4 +1,9 @@
|
||||||
import "bootstrap";
|
import "bootstrap";
|
||||||
|
|
||||||
import { profilePageAnimation } from '../users/lesson';
|
import { triggerModalEvent } from "../components/modal.js";
|
||||||
profilePageAnimation();
|
|
||||||
|
triggerModalEvent();
|
||||||
|
|
||||||
|
// import { profilePageAnimation } from '../users/lesson';
|
||||||
|
|
||||||
|
// profilePageAnimation();
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
import "bootstrap";
|
|
||||||
|
|
||||||
const btn = document.getElementById("modalTrigger");
|
|
||||||
const modal = document.getElementById("myModal");
|
|
||||||
|
|
||||||
btn.addEventListener('click', function(event) {
|
|
||||||
$('#myModal').modal('show');
|
|
||||||
});
|
|
|
@ -15,5 +15,6 @@
|
||||||
<%= yield %>
|
<%= yield %>
|
||||||
<%= javascript_include_tag 'application' %>
|
<%= javascript_include_tag 'application' %>
|
||||||
<%= javascript_pack_tag 'application' %>
|
<%= javascript_pack_tag 'application' %>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -61,4 +61,3 @@ end
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<%= javascript_pack_tag 'modal' %>
|
|
||||||
|
|
Loading…
Reference in New Issue