mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-15 04:02:38 +00:00
Updated style to navbar
This commit is contained in:
@@ -3,11 +3,12 @@
|
|||||||
position : relative;
|
position : relative;
|
||||||
width : 100%;
|
width : 100%;
|
||||||
.snippetBar{
|
.snippetBar{
|
||||||
display : flex;
|
@height : 25px;
|
||||||
padding : 5px;
|
position : relative;
|
||||||
|
height : @height;
|
||||||
background-color : #ddd;
|
background-color : #ddd;
|
||||||
align-items : center;
|
|
||||||
.snippetGroup{
|
.snippetGroup{
|
||||||
|
/*
|
||||||
.animate(background-color);
|
.animate(background-color);
|
||||||
margin : 0px 8px;
|
margin : 0px 8px;
|
||||||
padding : 3px;
|
padding : 3px;
|
||||||
@@ -16,8 +17,26 @@
|
|||||||
&:hover, &.selected{
|
&:hover, &.selected{
|
||||||
background-color : #999;
|
background-color : #999;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
display : inline-block;
|
||||||
|
height : @height;
|
||||||
|
padding : 0px 5px;
|
||||||
|
cursor : pointer;
|
||||||
|
font-size : 0.6em;
|
||||||
|
font-weight : 800;
|
||||||
|
line-height : @height;
|
||||||
|
text-transform : uppercase;
|
||||||
|
border-right : 1px solid black;
|
||||||
|
i{
|
||||||
|
vertical-align : middle;
|
||||||
|
margin-right : 3px;
|
||||||
|
font-size : 1.2em;
|
||||||
|
}
|
||||||
|
&:hover, &.selected{
|
||||||
|
background-color : #999;
|
||||||
|
}
|
||||||
.text{
|
.text{
|
||||||
line-height : 20px;
|
line-height : @height;
|
||||||
.groupName{
|
.groupName{
|
||||||
margin-left : 6px;
|
margin-left : 6px;
|
||||||
font-size : 10px;
|
font-size : 10px;
|
||||||
@@ -31,8 +50,10 @@
|
|||||||
.dropdown{
|
.dropdown{
|
||||||
position : absolute;
|
position : absolute;
|
||||||
visibility : hidden;
|
visibility : hidden;
|
||||||
|
top : 100%;
|
||||||
z-index : 1000;
|
z-index : 1000;
|
||||||
padding : 5px;
|
padding : 0px;
|
||||||
|
margin-left: -5px;
|
||||||
background-color : #ddd;
|
background-color : #ddd;
|
||||||
.snippet{
|
.snippet{
|
||||||
.animate(background-color);
|
.animate(background-color);
|
||||||
|
|||||||
@@ -26,8 +26,6 @@ const NewPage = React.createClass({
|
|||||||
errors : []
|
errors : []
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
componentDidMount: function() {
|
componentDidMount: function() {
|
||||||
const storage = localStorage.getItem(KEY);
|
const storage = localStorage.getItem(KEY);
|
||||||
if(storage){
|
if(storage){
|
||||||
@@ -80,7 +78,6 @@ const NewPage = React.createClass({
|
|||||||
text : this.state.text
|
text : this.state.text
|
||||||
})
|
})
|
||||||
.end((err, res)=>{
|
.end((err, res)=>{
|
||||||
|
|
||||||
if(err){
|
if(err){
|
||||||
this.setState({
|
this.setState({
|
||||||
isSaving : false
|
isSaving : false
|
||||||
|
|||||||
@@ -1,17 +1,16 @@
|
|||||||
var React = require('react');
|
const React = require('react');
|
||||||
var _ = require('lodash');
|
const _ = require('lodash');
|
||||||
var cx = require('classnames');
|
const cx = require('classnames');
|
||||||
|
|
||||||
var Nav = require('naturalcrit/nav/nav.jsx');
|
const Nav = require('naturalcrit/nav/nav.jsx');
|
||||||
var Navbar = require('../../navbar/navbar.jsx');
|
const Navbar = require('../../navbar/navbar.jsx');
|
||||||
var PrintLink = require('../../navbar/print.navitem.jsx');
|
const PrintLink = require('../../navbar/print.navitem.jsx');
|
||||||
var RecentlyViewed = require('../../navbar/recent.navitem.jsx').viewed;
|
const RecentlyViewed = require('../../navbar/recent.navitem.jsx').viewed;
|
||||||
|
|
||||||
var BrewRenderer = require('../../brewRenderer/brewRenderer.jsx');
|
const BrewRenderer = require('../../brewRenderer/brewRenderer.jsx');
|
||||||
|
|
||||||
var HijackPrint = require('../hijackPrint.js');
|
|
||||||
|
|
||||||
var SharePage = React.createClass({
|
const SharePage = React.createClass({
|
||||||
getDefaultProps: function() {
|
getDefaultProps: function() {
|
||||||
return {
|
return {
|
||||||
ver : '0.0.0',
|
ver : '0.0.0',
|
||||||
@@ -27,10 +26,17 @@ var SharePage = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
componentDidMount: function() {
|
componentDidMount: function() {
|
||||||
document.onkeydown = HijackPrint(this.props.brew.shareId);
|
document.addEventListener('keydown', this.handleControlKeys);
|
||||||
},
|
},
|
||||||
componentWillUnmount: function() {
|
componentWillUnmount: function() {
|
||||||
document.onkeydown = function(){};
|
document.removeEventListener('keydown', this.handleControlKeys);
|
||||||
|
},
|
||||||
|
handleControlKeys : function(e){
|
||||||
|
if(!(e.ctrlKey || e.metaKey)) return;
|
||||||
|
e.stopPropagation();
|
||||||
|
e.preventDefault();
|
||||||
|
const P_KEY = 80;
|
||||||
|
if(e.keyCode == P_KEY) window.open(`/print/${this.props.brew.shareId}?dialog=true`, '_blank').focus();
|
||||||
},
|
},
|
||||||
|
|
||||||
render : function(){
|
render : function(){
|
||||||
|
|||||||
Reference in New Issue
Block a user