browser: make input number types readonly in share objects modal (#4273)

master
Rushan 8 years ago committed by Harshavardhana
parent 610dbe3479
commit d13aa1c42d
  1. 26
      browser/app/js/components/Browse.js
  2. 13
      browser/app/less/inc/form.less

@ -722,11 +722,11 @@ export default class Browse extends React.Component {
</div> </div>
<div className="input-group" style={ { display: web.LoggedIn() ? 'block' : 'none' } }> <div className="input-group" style={ { display: web.LoggedIn() ? 'block' : 'none' } }>
<label> <label>
Expires in Expires in (Max 7 days)
</label> </label>
<div className="set-expire"> <div className="set-expire">
<div className="set-expire-item"> <div className="set-expire-item">
<i className="set-expire-increase" onClick={ this.handleExpireValue.bind(this, 'expireDays', 1, shareObject.object) }></i> <i className="set-expire-increase" onClick={ this.handleExpireValue.bind(this, 'expireDays', 1, shareObject.object) } />
<div className="set-expire-title"> <div className="set-expire-title">
Days Days
</div> </div>
@ -735,12 +735,14 @@ export default class Browse extends React.Component {
type="number" type="number"
min={ 0 } min={ 0 }
max={ 7 } max={ 7 }
defaultValue={ 5 } /> defaultValue={ 5 }
readOnly="readOnly"
/>
</div> </div>
<i className="set-expire-decrease" onClick={ this.handleExpireValue.bind(this, 'expireDays', -1, shareObject.object) }></i> <i className="set-expire-decrease" onClick={ this.handleExpireValue.bind(this, 'expireDays', -1, shareObject.object) } />
</div> </div>
<div className="set-expire-item"> <div className="set-expire-item">
<i className="set-expire-increase" onClick={ this.handleExpireValue.bind(this, 'expireHours', 1, shareObject.object) }></i> <i className="set-expire-increase" onClick={ this.handleExpireValue.bind(this, 'expireHours', 1, shareObject.object) } />
<div className="set-expire-title"> <div className="set-expire-title">
Hours Hours
</div> </div>
@ -749,12 +751,14 @@ export default class Browse extends React.Component {
type="number" type="number"
min={ 0 } min={ 0 }
max={ 23 } max={ 23 }
defaultValue={ 0 } /> defaultValue={ 0 }
readOnly="readOnly"
/>
</div> </div>
<i className="set-expire-decrease" onClick={ this.handleExpireValue.bind(this, 'expireHours', -1, shareObject.object) }></i> <i className="set-expire-decrease" onClick={ this.handleExpireValue.bind(this, 'expireHours', -1, shareObject.object) } />
</div> </div>
<div className="set-expire-item"> <div className="set-expire-item">
<i className="set-expire-increase" onClick={ this.handleExpireValue.bind(this, 'expireMins', 1, shareObject.object) }></i> <i className="set-expire-increase" onClick={ this.handleExpireValue.bind(this, 'expireMins', 1, shareObject.object) } />
<div className="set-expire-title"> <div className="set-expire-title">
Minutes Minutes
</div> </div>
@ -763,9 +767,11 @@ export default class Browse extends React.Component {
type="number" type="number"
min={ 0 } min={ 0 }
max={ 59 } max={ 59 }
defaultValue={ 0 } /> defaultValue={ 0 }
readOnly="readOnly"
/>
</div> </div>
<i className="set-expire-decrease" onClick={ this.handleExpireValue.bind(this, 'expireMins', -1, shareObject.object) }></i> <i className="set-expire-decrease" onClick={ this.handleExpireValue.bind(this, 'expireMins', -1, shareObject.object) } />
</div> </div>
</div> </div>
</div> </div>

@ -183,6 +183,17 @@ select.form-control {
.set-expire { .set-expire {
border: 1px solid @input-border; border: 1px solid @input-border;
margin: 35px 0 30px; margin: 35px 0 30px;
position: relative;
&:before {
content: '';
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 1;
}
} }
.set-expire-item { .set-expire-item {
@ -191,6 +202,7 @@ select.form-control {
display: table-cell; display: table-cell;
width: 1%; width: 1%;
text-align: center; text-align: center;
.user-select(none);
&:not(:last-child) { &:not(:last-child) {
border-right: 1px solid @input-border; border-right: 1px solid @input-border;
@ -209,6 +221,7 @@ select.form-control {
left: -8px; left: -8px;
input { input {
.user-select(none);
font-size: 20px; font-size: 20px;
text-align: center; text-align: center;
position: relative; position: relative;

Loading…
Cancel
Save