Skip to content

Commit

Permalink
Add identifiers to chat embed divs
Browse files Browse the repository at this point in the history
  • Loading branch information
Berkeley Martinez authored and Berkeley Martinez committed Oct 16, 2015
1 parent 35219cd commit 465a3e3
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 9 deletions.
17 changes: 17 additions & 0 deletions client/less/chat.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.gitter-chat-embed {
z-index: 100;
position: fixed;

top: 0;
left: 60%;
bottom: 0;
right: 0;

display: flex;
flex-direction: row;
transition: transform 0.3s cubic-bezier(0.16, 0.22, 0.22, 1.7);
}

.gitter-chat-embed.is-collapsed:not(.is-loading) {
transform: translateX(110%);
}
2 changes: 2 additions & 0 deletions client/less/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -1063,3 +1063,5 @@ code {
transform: rotate(0deg);
}
}

@import "chat.less";
26 changes: 18 additions & 8 deletions client/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,38 @@ main = (function(main) {
main.chat.GitterChat = e.detail.Chat;

main.chat.createHelpChat = function(room, helpChatBtnClass) {

$('body').append(
'<aside id="chat-embed-help" class="gitter-chat-embed is-collapsed" />'
);

main.chat.helpChat = new main.chat.GitterChat({
room: room,
activationElement: document.createElement('div')
activationElement: false,
targetElement: $('#chat-embed-help')
});

$(helpChatBtnClass).on('click', function() {
main.chat.helpChat.toggleChat(true);
});
};

$('body').append(
'<aside id="chat-embed-main" class="gitter-chat-embed is-collapsed" />'
);

main.chat.mainChat = new main.chat.GitterChat({
room: 'freecodecamp/freecodecamp',
activationElement: document.createElement('div')
activationElement: false,
targetElement: $('#chat-embed-main')
});

$('#nav-chat-btn').on('click', function() {
console.log('Create');
if (!main.chat.isOpen) {
$('#nav-chat-btn').on('click', function() {
if (!main.chat.isOpen) {

main.chat.mainChat.toggleChat(true);
}
});
main.chat.mainChat.toggleChat(true);
}
});
});

return main;
Expand Down
3 changes: 2 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ var paths = {
],

less: './client/less/main.less',
lessFiles: './client/less/*.less',

manifest: 'server/manifests/',

Expand Down Expand Up @@ -392,7 +393,7 @@ var watchDependents = [
];

gulp.task('watch', watchDependents, function() {
gulp.watch(paths.less, ['less']);
gulp.watch(paths.lessFiles, ['less']);
gulp.watch(paths.js, ['js']);
gulp.watch(paths.challenges, ['test-challenges']);
gulp.watch(paths.js, ['js', 'dependents']);
Expand Down

0 comments on commit 465a3e3

Please sign in to comment.