diff --git a/skins/base/css/molecules/MatrixToolbar.css b/skins/base/css/molecules/MatrixToolbar.css new file mode 100644 index 000000000..9c3afd550 --- /dev/null +++ b/skins/base/css/molecules/MatrixToolbar.css @@ -0,0 +1,24 @@ +/* +Copyright 2015 OpenMarket Ltd + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +.mx_MatrixToolbar { + text-align: center; + height: 25px; + background-color: #a9dbf4; + border-bottom: 1px solid #000; + padding: 6px; + z-index: 50; +} \ No newline at end of file diff --git a/skins/base/views/organisms/RoomView.js b/skins/base/views/organisms/RoomView.js index 6ecd02d70..7aa9de833 100644 --- a/skins/base/views/organisms/RoomView.js +++ b/skins/base/views/organisms/RoomView.js @@ -31,7 +31,8 @@ var RoomHeader = ComponentBroker.get('molecules/RoomHeader'); var MessageComposer = ComponentBroker.get('molecules/MessageComposer'); var CallView = ComponentBroker.get("molecules/voip/CallView"); var RoomSettings = ComponentBroker.get("molecules/RoomSettings"); - +var Notifier = ComponentBroker.get('organisms/Notifier'); +var MatrixToolbar = ComponentBroker.get('molecules/MatrixToolbar'); var RoomViewController = require("../../../../src/controllers/organisms/RoomView"); var Loader = require("react-loader"); @@ -142,8 +143,14 @@ module.exports = React.createClass({ roomEdit = ; } + var top_bar; + if (!Notifier.isEnabled()) { + top_bar = ; + } + return (
+ {top_bar}
diff --git a/skins/base/views/pages/MatrixChat.js b/skins/base/views/pages/MatrixChat.js index 5486d2aff..73af50824 100644 --- a/skins/base/views/pages/MatrixChat.js +++ b/skins/base/views/pages/MatrixChat.js @@ -27,8 +27,6 @@ var UserSettings = ComponentBroker.get('organisms/UserSettings'); var Register = ComponentBroker.get('templates/Register'); var CreateRoom = ComponentBroker.get('organisms/CreateRoom'); var RoomDirectory = ComponentBroker.get('organisms/RoomDirectory'); -var Notifier = ComponentBroker.get('organisms/Notifier'); -var MatrixToolbar = ComponentBroker.get('molecules/MatrixToolbar'); var MatrixChatController = require("../../../../src/controllers/pages/MatrixChat"); @@ -54,11 +52,6 @@ module.exports = React.createClass({ var page_element; var right_panel = ""; - var top_bar; - - if (!Notifier.isEnabled()) { - top_bar = ; - } switch (this.state.page_type) { case this.PageTypes.RoomView: @@ -81,7 +74,6 @@ module.exports = React.createClass({ return (
- {top_bar}
{page_element} diff --git a/src/controllers/organisms/RoomView.js b/src/controllers/organisms/RoomView.js index 311a3e1e2..8465b2ce8 100644 --- a/src/controllers/organisms/RoomView.js +++ b/src/controllers/organisms/RoomView.js @@ -32,6 +32,7 @@ var PAGINATE_SIZE = 20; var INITIAL_SIZE = 100; var ComponentBroker = require('../../ComponentBroker'); +var Notifier = ComponentBroker.get('organisms/Notifier'); var tileTypes = { 'm.room.message': ComponentBroker.get('molecules/MessageTile'), @@ -83,6 +84,9 @@ module.exports = { room: MatrixClientPeg.get().getRoom(this.props.roomId) }); break; + case'notifier_enabled': + this.forceUpdate(); + break; } }, diff --git a/src/controllers/pages/MatrixChat.js b/src/controllers/pages/MatrixChat.js index 2cb70d9b0..f72d793da 100644 --- a/src/controllers/pages/MatrixChat.js +++ b/src/controllers/pages/MatrixChat.js @@ -25,7 +25,6 @@ var Presence = require("../../Presence"); var dis = require("../../dispatcher"); var ComponentBroker = require('../../ComponentBroker'); - var Notifier = ComponentBroker.get('organisms/Notifier'); module.exports = { @@ -163,9 +162,6 @@ module.exports = { page_type: this.PageTypes.RoomDirectory, }); break; - case'notifier_enabled': - this.forceUpdate(); - break; } },