Use embedded instead of mini

pull/4319/head
Diego Sampaio 9 years ago
parent 350fe6b500
commit 7ccfbe9bc8
  1. 2
      client/routes/router.coffee
  2. 11
      packages/rocketchat-lib/client/lib/Layout.js
  3. 2
      packages/rocketchat-lib/client/lib/openRoom.coffee
  4. 1
      packages/rocketchat-lib/package.js
  5. 2
      packages/rocketchat-theme/assets/stylesheets/base.less
  6. 6
      packages/rocketchat-ui-master/master/main.coffee
  7. 2
      packages/rocketchat-ui-master/master/main.html
  8. 2
      packages/rocketchat-ui/lib/chatMessages.coffee
  9. 10
      packages/rocketchat-ui/views/app/room.coffee
  10. 2
      packages/rocketchat-ui/views/app/room.html

@ -14,7 +14,7 @@ FlowRouter.route '/',
name: 'index'
action: ->
BlazeLayout.render 'main', { modal: !!FlowRouter.getQueryParam('mini'), center: 'loading' }
BlazeLayout.render 'main', { modal: RocketChat.Layout.isEmbedded(), center: 'loading' }
if not Meteor.userId()
return FlowRouter.go 'home'

@ -0,0 +1,11 @@
RocketChat.Layout = new (class RocketChatLayout {
constructor() {
Tracker.autorun(() => {
this.layout = FlowRouter.getQueryParam('layout');
});
}
isEmbedded() {
return this.layout === 'embedded';
}
});

@ -6,7 +6,7 @@ currentTracker = undefined
Meteor.defer ->
currentTracker = Tracker.autorun (c) ->
if RoomManager.open(type + name).ready() isnt true
BlazeLayout.render 'main', { modal: !!FlowRouter.getQueryParam('mini'), center: 'loading' }
BlazeLayout.render 'main', { modal: RocketChat.Layout.isEmbedded(), center: 'loading' }
return
user = Meteor.user()

@ -149,6 +149,7 @@ Package.onUse(function(api) {
api.addFiles('client/lib/settings.coffee', 'client');
api.addFiles('client/lib/roomTypes.coffee', 'client');
api.addFiles('client/lib/userRoles.js', 'client');
api.addFiles('client/lib/Layout.js', 'client');
// CLIENT METHODS
api.addFiles('client/methods/sendMessage.coffee', 'client');

@ -4636,7 +4636,7 @@ a + br.only-after-a {
}
}
.mini-view {
.embedded-view {
.main-content.main-modal {
right: 0;
}

@ -35,7 +35,7 @@ Template.body.onRendered ->
e.preventDefault()
e.stopPropagation()
if FlowRouter.getQueryParam('mini')
if RocketChat.Layout.isEmbedded()
fireGlobalEvent('click-message-link', { link: link.pathname + link.search })
return window.open(link.pathname + link.search)
@ -173,8 +173,8 @@ Template.main.helpers
CustomScriptLoggedIn: ->
RocketChat.settings.get 'Custom_Script_Logged_In'
miniVersion: ->
return 'mini-view' if FlowRouter.getQueryParam('mini')
embeddedVersion: ->
return 'embedded-view' if RocketChat.Layout.isEmbedded()
Template.main.events

@ -64,7 +64,7 @@
{{> spotlight}}
{{> videoCall overlay=true}}
<div id="user-card-popover"></div>
<div id="rocket-chat" class="{{miniVersion}} menu-nav menu-closed">
<div id="rocket-chat" class="{{embeddedVersion}} menu-nav menu-closed">
<div class="connection-status">
{{> status}}
</div>

@ -11,7 +11,7 @@ class @ChatMessages
return
resize: ->
dif = (if !!FlowRouter.getQueryParam('mini') then 0 else 60) + $(".messages-container").find("footer").outerHeight()
dif = (if RocketChat.Layout.isEmbedded() then 0 else 60) + $(".messages-container").find("footer").outerHeight()
$(".messages-box").css
height: "calc(100% - #{dif}px)"

@ -11,8 +11,8 @@ userCanDrop = (_id) ->
return !RocketChat.roomTypes.readOnly _id, Meteor.user()
Template.room.helpers
miniVersion: ->
return FlowRouter.getQueryParam('mini')
embeddedVersion: ->
return RocketChat.Layout.isEmbedded()
favorite: ->
sub = ChatSubscription.findOne { rid: this._id }, { fields: { f: 1 } }
@ -308,7 +308,7 @@ Template.room.events
'click .user-card-message': (e, instance) ->
roomData = Session.get('roomData' + this._arguments[1].rid)
if FlowRouter.getQueryParam('mini')
if RocketChat.Layout.isEmbedded()
fireGlobalEvent('click-user-card-message', { username: this._arguments[1].u.username })
e.preventDefault()
e.stopPropagation()
@ -364,14 +364,14 @@ Template.room.events
"click .mention-link": (e, instance) ->
channel = $(e.currentTarget).data('channel')
if channel?
if FlowRouter.getQueryParam('mini')
if RocketChat.Layout.isEmbedded()
fireGlobalEvent('click-mention-link', { channel: channel })
return window.open(FlowRouter.path('channel', {name: channel}))
FlowRouter.go 'channel', {name: channel}
return
if FlowRouter.getQueryParam('mini')
if RocketChat.Layout.isEmbedded()
fireGlobalEvent('click-mention-link', { username: $(e.currentTarget).data('username') })
e.stopPropagation();
e.preventDefault();

@ -6,7 +6,7 @@
</div>
</div>
<section class="messages-container {{adminClass}}" id="{{windowId}}" aria-label="{{_ "Channel"}}">
{{#unless miniVersion}}
{{#unless embeddedVersion}}
<header class="fixed-title">
{{> burger}}
<h2>

Loading…
Cancel
Save