Browse Source

fixed all modals

master
Julian Steinwachs 9 years ago
parent
commit
beca543c04
  1. 147
      build/app-bundle.js
  2. 2
      jsx/common/Post.js
  3. 40
      jsx/common/ReplyModalButton.js
  4. 27
      jsx/common/RetwistModalButton.js
  5. 10
      jsx/home/NewPostModalButton.js
  6. 26
      jsx/other/ImportAccountModalButton.js
  7. 23
      jsx/profile/EditAvatarModalButton.js
  8. 23
      jsx/profile/EditProfileModalButton.js

147
build/app-bundle.js

@ -600,7 +600,7 @@ module.exports = Post = React.createClass({displayName: "Post", @@ -600,7 +600,7 @@ module.exports = Post = React.createClass({displayName: "Post",
fullname: "",
timeAgo: "",
retwistingUsername: this.props.post.username,
retwistingUserFullname: "",
retwistingUserFullname: this.props.post.username,
retwistingUserAvatar: "img/genericPerson.png",
};
},
@ -869,7 +869,7 @@ module.exports = PostComposer = React.createClass({displayName: "PostComposer", @@ -869,7 +869,7 @@ module.exports = PostComposer = React.createClass({displayName: "PostComposer",
tagName: "div",
html: this.state.html,
placeholder: this.state.placeholder,
placeholderText: "Compose Your Twist",
placeholderText: "write",
onKeyPress: this.onKeyPress,
preventStyling: true,
noLinebreaks: true,
@ -890,12 +890,12 @@ module.exports = PostComposer = React.createClass({displayName: "PostComposer", @@ -890,12 +890,12 @@ module.exports = PostComposer = React.createClass({displayName: "PostComposer",
"Twist"
)
)
),
React.createElement("div", null,
"Show autocomplete? ", this.state.queryMention ? 'Yes ' + this.state.queryMention : 'No'
)
)
);
/*<div>
Show autocomplete? {this.state.queryMention ? 'Yes ' + this.state.queryMention : 'No'}
</div>*/
},
handleSubmit: function(){
@ -925,7 +925,7 @@ module.exports = PostComposer = React.createClass({displayName: "PostComposer", @@ -925,7 +925,7 @@ module.exports = PostComposer = React.createClass({displayName: "PostComposer",
var parsedContent = PostContentHelper.parseContent(copy);
console.log(copy,parsedContent);
//console.log(copy,parsedContent);
var output = "";
@ -1397,7 +1397,6 @@ module.exports = ProfileMixin = { @@ -1397,7 +1397,6 @@ module.exports = ProfileMixin = {
},{"../common/AppSettingsMixin.js":2,"../common/EventListenerMixin.js":3}],13:[function(require,module,exports){
var ReactBootstrap = require('react-bootstrap')
, OverlayMixin = ReactBootstrap.OverlayMixin
, Button = ReactBootstrap.Button
, ButtonGroup = ReactBootstrap.ButtonGroup
, Glyphicon = ReactBootstrap.Glyphicon
@ -1411,7 +1410,6 @@ var SetIntervalMixin = require("../common/SetIntervalMixin.js"); @@ -1411,7 +1410,6 @@ var SetIntervalMixin = require("../common/SetIntervalMixin.js");
var PostContent = require("../common/PostContent.js");
module.exports = ReplyModalButton = React.createClass({displayName: "ReplyModalButton",
mixins: [OverlayMixin],
getInitialState: function () {
return {
isModalOpen: false
@ -1422,10 +1420,7 @@ module.exports = ReplyModalButton = React.createClass({displayName: "ReplyModalB @@ -1422,10 +1420,7 @@ module.exports = ReplyModalButton = React.createClass({displayName: "ReplyModalB
isModalOpen: !this.state.isModalOpen
});
},
handleReply: function (e) {
e.preventDefault();
//console.log(e)
var msg = JSON.parse(JSON.stringify(e.target[0].value));
handleReply: function (msg) {
if (!msg) {
console.log("empty post was passed as new post")
return;
@ -1443,9 +1438,6 @@ module.exports = ReplyModalButton = React.createClass({displayName: "ReplyModalB @@ -1443,9 +1438,6 @@ module.exports = ReplyModalButton = React.createClass({displayName: "ReplyModalB
});
e.target[0].value = "";
this.handleToggle();
//React.findDOMNode(this.refs.msg).value = '';
@ -1453,36 +1445,25 @@ module.exports = ReplyModalButton = React.createClass({displayName: "ReplyModalB @@ -1453,36 +1445,25 @@ module.exports = ReplyModalButton = React.createClass({displayName: "ReplyModalB
},
render: function() {
return (
React.createElement("a", {onClick: this.handleToggle, className: "link-button-gray"}, React.createElement(Glyphicon, {glyph: "arrow-left"}))
);
},
renderOverlay: function() {
if (!this.state.isModalOpen) {
return React.createElement("span", null);
}
return (
React.createElement(Modal, {bsStyle: "primary", title:
React.createElement("a", {onClick: this.handleToggle, className: "link-button-gray"},
React.createElement(Glyphicon, {glyph: "arrow-left"}),
onRequestHide: this.handleToggle},
React.createElement("div", {className: "modal-body"},
React.createElement("form", {onSubmit: this.handleReply},
React.createElement("strong", null, this.props.replyUserFullname), " ",
React.createElement(Modal, {bsStyle: "primary", show: this.state.isModalOpen, onHide: this.handleToggle},
React.createElement(Modal.Header, null,
React.createElement(Glyphicon, {glyph: "arrow-left"})
),
React.createElement(Modal.Body, null,
React.createElement("strong", null, this.props.replyUserFullname),
React.createElement(PostContent, {content: this.props.originalMsg}),
React.createElement(Input, {type: "textarea", label: "", placeholder: "textarea"}),
React.createElement(Input, {type: "submit", value: "Reply", "data-dismiss": "modal"})
React.createElement(PostComposer, {onSubmit: this.handleReply})
)
)
)
);
}
});
},{"../common/PostContent.js":8,"../common/SafeStateChangeMixin.js":15,"../common/SetIntervalMixin.js":16,"react":500,"react-bootstrap":107}],14:[function(require,module,exports){
var ReactBootstrap = require('react-bootstrap')
, OverlayMixin = ReactBootstrap.OverlayMixin
, Button = ReactBootstrap.Button
, ButtonGroup = ReactBootstrap.ButtonGroup
, Glyphicon = ReactBootstrap.Glyphicon
@ -1496,7 +1477,6 @@ var SetIntervalMixin = require("../common/SetIntervalMixin.js"); @@ -1496,7 +1477,6 @@ var SetIntervalMixin = require("../common/SetIntervalMixin.js");
var PostContent = require("../common/PostContent.js");
module.exports = RetwistModalButton = React.createClass({displayName: "RetwistModalButton",
mixins: [OverlayMixin],
getInitialState: function () {
return {
isModalOpen: false
@ -1529,29 +1509,22 @@ module.exports = RetwistModalButton = React.createClass({displayName: "RetwistMo @@ -1529,29 +1509,22 @@ module.exports = RetwistModalButton = React.createClass({displayName: "RetwistMo
},
render: function() {
return (
React.createElement("a", {onClick: this.handleToggle, className: "link-button-gray"}, React.createElement(Glyphicon, {glyph: "retweet"}))
);
},
renderOverlay: function() {
if (!this.state.isModalOpen) {
return React.createElement("span", null);
}
return (
React.createElement(Modal, {bsStyle: "primary", title:
React.createElement("a", {onClick: this.handleToggle, className: "link-button-gray"},
React.createElement(Glyphicon, {glyph: "retweet"}),
onRequestHide: this.handleToggle},
React.createElement("div", {className: "modal-body"},
React.createElement(Modal, {show: this.state.isModalOpen, bsStyle: "primary", onHide: this.handleToggle},
React.createElement(Modal.Header, null,
React.createElement(Glyphicon, {glyph: "retweet"})
),
React.createElement(Modal.Body, null,
React.createElement("form", {onSubmit: this.handleRetwist},
React.createElement("strong", null, this.props.retwistUserFullname), " ",
React.createElement("strong", null, this.props.retwistUserFullname, " "),
React.createElement(PostContent, {content: this.props.originalMsg}),
React.createElement(Input, {type: "submit", value: "Retwist", "data-dismiss": "modal"})
)
)
)
)
);
}
});
},{"../common/PostContent.js":8,"../common/SafeStateChangeMixin.js":15,"../common/SetIntervalMixin.js":16,"react":500,"react-bootstrap":107}],15:[function(require,module,exports){
@ -1871,6 +1844,7 @@ var ReactBootstrap = require('react-bootstrap') @@ -1871,6 +1844,7 @@ var ReactBootstrap = require('react-bootstrap')
, Glyphicon = ReactBootstrap.Glyphicon
, Modal = ReactBootstrap.Modal
, Input = ReactBootstrap.Input
, ListGroupItem = ReactBootstrap.ListGroupItem
var React = require('react');
@ -1915,8 +1889,11 @@ module.exports = NewPostModalButton = React.createClass({displayName: "NewPostMo @@ -1915,8 +1889,11 @@ module.exports = NewPostModalButton = React.createClass({displayName: "NewPostMo
return (
React.createElement(Button, {onClick: this.handleToggle, className: "link-button-gray pull-right fullytight_all", bsStyle: "link"},
React.createElement(Glyphicon, {glyph: "pencil"}),
React.createElement(Modal, {title: React.createElement(Glyphicon, {glyph: "pencil"}), show: this.state.isModalOpen, bsStyle: "primary", onHide: this.handleToggle},
React.createElement("div", {className: "modal-body"},
React.createElement(Modal, {show: this.state.isModalOpen, bsStyle: "primary", onHide: this.handleToggle},
React.createElement(Modal.Header, null,
React.createElement(Glyphicon, {glyph: "pencil"})
),
React.createElement(Modal.Body, null,
React.createElement(PostComposer, {onSubmit: this.handleNewPost})
)
)
@ -2215,7 +2192,6 @@ module.exports = Hashtag = React.createClass({displayName: "Hashtag", @@ -2215,7 +2192,6 @@ module.exports = Hashtag = React.createClass({displayName: "Hashtag",
},{"../common/AppSettingsMixin.js":2,"../common/EventListenerMixin.js":3,"../common/Postboard.js":10,"../common/SafeStateChangeMixin.js":15,"../common/SetIntervalMixin.js":16,"../common/StreamMixin.js":17,"react":500,"react-bootstrap":107}],24:[function(require,module,exports){
var ReactBootstrap = require('react-bootstrap')
, OverlayMixin = ReactBootstrap.OverlayMixin
, Button = ReactBootstrap.Button
, ButtonGroup = ReactBootstrap.ButtonGroup
, Glyphicon = ReactBootstrap.Glyphicon
@ -2228,7 +2204,6 @@ var SafeStateChangeMixin = require('../common/SafeStateChangeMixin.js'); @@ -2228,7 +2204,6 @@ var SafeStateChangeMixin = require('../common/SafeStateChangeMixin.js');
var SetIntervalMixin = require("../common/SetIntervalMixin.js");
module.exports = ImportAccountModalButton = React.createClass({displayName: "ImportAccountModalButton",
mixins: [OverlayMixin],
getInitialState: function () {
return {
isModalOpen: false,
@ -2270,20 +2245,14 @@ module.exports = ImportAccountModalButton = React.createClass({displayName: "Imp @@ -2270,20 +2245,14 @@ module.exports = ImportAccountModalButton = React.createClass({displayName: "Imp
},
render: function() {
return (
React.createElement(Button, {onClick: this.handleToggle}, "Import Account")
);
},
renderOverlay: function() {
if (!this.state.isModalOpen) {
return React.createElement("span", null);
}
return (
React.createElement(Modal, {bsStyle: "primary", title: React.createElement(Glyphicon, {glyph: "pencil"}), onRequestHide: this.handleToggle},
React.createElement("div", {className: "modal-body"},
React.createElement(Button, {onClick: this.handleToggle},
"Import Account",
React.createElement(Modal, {show: this.state.isModalOpen, bsStyle: "primary", onHide: this.handleToggle},
React.createElement(Modal.Header, null,
React.createElement(Glyphicon, {glyph: "import"})
),
React.createElement(Modal.Body, null,
React.createElement("form", {onSubmit: this.handleImportAccount},
React.createElement(Input, {
type: "text",
@ -2301,8 +2270,8 @@ module.exports = ImportAccountModalButton = React.createClass({displayName: "Imp @@ -2301,8 +2270,8 @@ module.exports = ImportAccountModalButton = React.createClass({displayName: "Imp
)
)
)
)
);
}
});
},{"../common/SafeStateChangeMixin.js":15,"../common/SetIntervalMixin.js":16,"react":500,"react-bootstrap":107}],25:[function(require,module,exports){
@ -2382,7 +2351,6 @@ module.exports = Settings = React.createClass({displayName: "Settings", @@ -2382,7 +2351,6 @@ module.exports = Settings = React.createClass({displayName: "Settings",
var ReactBootstrap = require('react-bootstrap')
, OverlayMixin = ReactBootstrap.OverlayMixin
, Button = ReactBootstrap.Button
, ButtonGroup = ReactBootstrap.ButtonGroup
, Glyphicon = ReactBootstrap.Glyphicon
@ -2395,7 +2363,6 @@ var SafeStateChangeMixin = require('../common/SafeStateChangeMixin.js'); @@ -2395,7 +2363,6 @@ var SafeStateChangeMixin = require('../common/SafeStateChangeMixin.js');
var SetIntervalMixin = require("../common/SetIntervalMixin.js");
module.exports = EditAvatarModalButton = React.createClass({displayName: "EditAvatarModalButton",
mixins: [OverlayMixin,SafeStateChangeMixin],
getInitialState: function () {
return {
isModalOpen: false,
@ -2494,19 +2461,12 @@ module.exports = EditAvatarModalButton = React.createClass({displayName: "EditAv @@ -2494,19 +2461,12 @@ module.exports = EditAvatarModalButton = React.createClass({displayName: "EditAv
return (
React.createElement(Button, {onClick: this.handleToggle, className: "link-button-gray pull-right fullytight_all", bsStyle: "link"},
React.createElement(Glyphicon, {glyph: "pencil"}),
React.createElement(Modal, {bsStyle: "primary", show: this.state.isModalOpen, onHide: this.handleToggle},
React.createElement(Modal.Header, null,
React.createElement(Glyphicon, {glyph: "pencil"})
)
);
},
renderOverlay: function() {
if (!this.state.isModalOpen) {
return React.createElement("span", null);
}
return (
React.createElement(Modal, {bsStyle: "primary", title: React.createElement(Glyphicon, {glyph: "pencil"}), onRequestHide: this.handleToggle},
React.createElement("div", {className: "modal-body"},
),
React.createElement(Modal.Body, null,
React.createElement("form", {onSubmit: this.handleAvatarEdit},
React.createElement("img", {src: this.state.avatar}),
React.createElement(Input, {
@ -2518,14 +2478,13 @@ module.exports = EditAvatarModalButton = React.createClass({displayName: "EditAv @@ -2518,14 +2478,13 @@ module.exports = EditAvatarModalButton = React.createClass({displayName: "EditAv
)
)
)
)
);
}
});
},{"../common/SafeStateChangeMixin.js":15,"../common/SetIntervalMixin.js":16,"react":500,"react-bootstrap":107}],27:[function(require,module,exports){
var ReactBootstrap = require('react-bootstrap')
, OverlayMixin = ReactBootstrap.OverlayMixin
, Button = ReactBootstrap.Button
, ButtonGroup = ReactBootstrap.ButtonGroup
, Glyphicon = ReactBootstrap.Glyphicon
@ -2538,7 +2497,6 @@ var SafeStateChangeMixin = require('../common/SafeStateChangeMixin.js'); @@ -2538,7 +2497,6 @@ var SafeStateChangeMixin = require('../common/SafeStateChangeMixin.js');
var SetIntervalMixin = require("../common/SetIntervalMixin.js");
module.exports = EditProfileModalButton = React.createClass({displayName: "EditProfileModalButton",
mixins: [OverlayMixin],
getInitialState: function () {
return {
isModalOpen: false,
@ -2601,19 +2559,12 @@ module.exports = EditProfileModalButton = React.createClass({displayName: "EditP @@ -2601,19 +2559,12 @@ module.exports = EditProfileModalButton = React.createClass({displayName: "EditP
return (
React.createElement(Button, {onClick: this.handleToggle, className: "link-button-gray pull-right fullytight_all", bsStyle: "link"},
React.createElement(Glyphicon, {glyph: "pencil"}),
React.createElement(Modal, {bsStyle: "primary", show: this.state.isModalOpen, onHide: this.handleToggle},
React.createElement(Modal.Header, null,
React.createElement(Glyphicon, {glyph: "pencil"})
)
);
},
renderOverlay: function() {
if (!this.state.isModalOpen) {
return React.createElement("span", null);
}
return (
React.createElement(Modal, {bsStyle: "primary", title: React.createElement(Glyphicon, {glyph: "pencil"}), onRequestHide: this.handleToggle},
React.createElement("div", {className: "modal-body"},
),
React.createElement(Modal.Body, null,
React.createElement("form", {onSubmit: this.handleProfileEdit},
React.createElement(Input, {
type: "text",
@ -2643,8 +2594,8 @@ module.exports = EditProfileModalButton = React.createClass({displayName: "EditP @@ -2643,8 +2594,8 @@ module.exports = EditProfileModalButton = React.createClass({displayName: "EditP
)
)
)
)
);
}
});
},{"../common/SafeStateChangeMixin.js":15,"../common/SetIntervalMixin.js":16,"react":500,"react-bootstrap":107}],28:[function(require,module,exports){

2
jsx/common/Post.js

@ -58,7 +58,7 @@ module.exports = Post = React.createClass({ @@ -58,7 +58,7 @@ module.exports = Post = React.createClass({
fullname: "",
timeAgo: "",
retwistingUsername: this.props.post.username,
retwistingUserFullname: "",
retwistingUserFullname: this.props.post.username,
retwistingUserAvatar: "img/genericPerson.png",
};
},

40
jsx/common/ReplyModalButton.js

@ -1,6 +1,5 @@ @@ -1,6 +1,5 @@
var ReactBootstrap = require('react-bootstrap')
, OverlayMixin = ReactBootstrap.OverlayMixin
, Button = ReactBootstrap.Button
, ButtonGroup = ReactBootstrap.ButtonGroup
, Glyphicon = ReactBootstrap.Glyphicon
@ -14,7 +13,6 @@ var SetIntervalMixin = require("../common/SetIntervalMixin.js"); @@ -14,7 +13,6 @@ var SetIntervalMixin = require("../common/SetIntervalMixin.js");
var PostContent = require("../common/PostContent.js");
module.exports = ReplyModalButton = React.createClass({
mixins: [OverlayMixin],
getInitialState: function () {
return {
isModalOpen: false
@ -25,10 +23,7 @@ module.exports = ReplyModalButton = React.createClass({ @@ -25,10 +23,7 @@ module.exports = ReplyModalButton = React.createClass({
isModalOpen: !this.state.isModalOpen
});
},
handleReply: function (e) {
e.preventDefault();
//console.log(e)
var msg = JSON.parse(JSON.stringify(e.target[0].value));
handleReply: function (msg) {
if (!msg) {
console.log("empty post was passed as new post")
return;
@ -46,9 +41,6 @@ module.exports = ReplyModalButton = React.createClass({ @@ -46,9 +41,6 @@ module.exports = ReplyModalButton = React.createClass({
});
e.target[0].value = "";
this.handleToggle();
//React.findDOMNode(this.refs.msg).value = '';
@ -56,29 +48,19 @@ module.exports = ReplyModalButton = React.createClass({ @@ -56,29 +48,19 @@ module.exports = ReplyModalButton = React.createClass({
},
render: function() {
return (
<a onClick={this.handleToggle} className="link-button-gray"><Glyphicon glyph='arrow-left' /></a>
);
},
renderOverlay: function() {
if (!this.state.isModalOpen) {
return <span/>;
}
return (
<Modal bsStyle='primary' title={
<a onClick={this.handleToggle} className="link-button-gray">
<Glyphicon glyph='arrow-left' />
} onRequestHide={this.handleToggle}>
<div className='modal-body'>
<form onSubmit={this.handleReply}>
<strong>{this.props.replyUserFullname}</strong>&nbsp;
<Modal bsStyle='primary' show={this.state.isModalOpen} onHide={this.handleToggle}>
<Modal.Header>
<Glyphicon glyph='arrow-left'/>
</Modal.Header>
<Modal.Body>
<strong>{this.props.replyUserFullname}</strong>
<PostContent content={this.props.originalMsg}/>
<Input type='textarea' label='' placeholder='textarea'/>
<Input type='submit' value='Reply' data-dismiss="modal" />
</form>
</div>
<PostComposer onSubmit={this.handleReply} />
</Modal.Body>
</Modal>
</a>
);
}
});

27
jsx/common/RetwistModalButton.js

@ -1,6 +1,5 @@ @@ -1,6 +1,5 @@
var ReactBootstrap = require('react-bootstrap')
, OverlayMixin = ReactBootstrap.OverlayMixin
, Button = ReactBootstrap.Button
, ButtonGroup = ReactBootstrap.ButtonGroup
, Glyphicon = ReactBootstrap.Glyphicon
@ -14,7 +13,6 @@ var SetIntervalMixin = require("../common/SetIntervalMixin.js"); @@ -14,7 +13,6 @@ var SetIntervalMixin = require("../common/SetIntervalMixin.js");
var PostContent = require("../common/PostContent.js");
module.exports = RetwistModalButton = React.createClass({
mixins: [OverlayMixin],
getInitialState: function () {
return {
isModalOpen: false
@ -47,28 +45,21 @@ module.exports = RetwistModalButton = React.createClass({ @@ -47,28 +45,21 @@ module.exports = RetwistModalButton = React.createClass({
},
render: function() {
return (
<a onClick={this.handleToggle} className="link-button-gray"><Glyphicon glyph='retweet' /></a>
);
},
renderOverlay: function() {
if (!this.state.isModalOpen) {
return <span/>;
}
return (
<Modal bsStyle='primary' title={
<a onClick={this.handleToggle} className="link-button-gray">
<Glyphicon glyph='retweet' />
} onRequestHide={this.handleToggle}>
<div className='modal-body'>
<Modal show={this.state.isModalOpen} bsStyle='primary' onHide={this.handleToggle}>
<Modal.Header>
<Glyphicon glyph='retweet'/>
</Modal.Header>
<Modal.Body>
<form onSubmit={this.handleRetwist}>
<strong>{this.props.retwistUserFullname}</strong>&nbsp;
<strong>{this.props.retwistUserFullname} </strong>
<PostContent content={this.props.originalMsg}/>
<Input type='submit' value='Retwist' data-dismiss="modal" />
</form>
</div>
</Modal.Body>
</Modal>
</a>
);
}
});

10
jsx/home/NewPostModalButton.js

@ -5,6 +5,7 @@ var ReactBootstrap = require('react-bootstrap') @@ -5,6 +5,7 @@ var ReactBootstrap = require('react-bootstrap')
, Glyphicon = ReactBootstrap.Glyphicon
, Modal = ReactBootstrap.Modal
, Input = ReactBootstrap.Input
, ListGroupItem = ReactBootstrap.ListGroupItem
var React = require('react');
@ -49,10 +50,13 @@ module.exports = NewPostModalButton = React.createClass({ @@ -49,10 +50,13 @@ module.exports = NewPostModalButton = React.createClass({
return (
<Button onClick={this.handleToggle} className="link-button-gray pull-right fullytight_all" bsStyle="link">
<Glyphicon glyph='pencil' />
<Modal title={<Glyphicon glyph='pencil'/>} show={this.state.isModalOpen} bsStyle='primary' onHide={this.handleToggle}>
<div className='modal-body'>
<Modal show={this.state.isModalOpen} bsStyle='primary' onHide={this.handleToggle}>
<Modal.Header>
<Glyphicon glyph='pencil'/>
</Modal.Header>
<Modal.Body>
<PostComposer onSubmit={this.handleNewPost} />
</div>
</Modal.Body>
</Modal>
</Button>
);

26
jsx/other/ImportAccountModalButton.js

@ -1,6 +1,5 @@ @@ -1,6 +1,5 @@
var ReactBootstrap = require('react-bootstrap')
, OverlayMixin = ReactBootstrap.OverlayMixin
, Button = ReactBootstrap.Button
, ButtonGroup = ReactBootstrap.ButtonGroup
, Glyphicon = ReactBootstrap.Glyphicon
@ -13,7 +12,6 @@ var SafeStateChangeMixin = require('../common/SafeStateChangeMixin.js'); @@ -13,7 +12,6 @@ var SafeStateChangeMixin = require('../common/SafeStateChangeMixin.js');
var SetIntervalMixin = require("../common/SetIntervalMixin.js");
module.exports = ImportAccountModalButton = React.createClass({
mixins: [OverlayMixin],
getInitialState: function () {
return {
isModalOpen: false,
@ -55,20 +53,14 @@ module.exports = ImportAccountModalButton = React.createClass({ @@ -55,20 +53,14 @@ module.exports = ImportAccountModalButton = React.createClass({
},
render: function() {
return (
<Button onClick={this.handleToggle}>Import Account</Button>
);
},
renderOverlay: function() {
if (!this.state.isModalOpen) {
return <span/>;
}
return (
<Modal bsStyle='primary' title={<Glyphicon glyph='pencil'/>} onRequestHide={this.handleToggle}>
<div className='modal-body'>
<Button onClick={this.handleToggle}>
Import Account
<Modal show={this.state.isModalOpen} bsStyle='primary' onHide={this.handleToggle}>
<Modal.Header>
<Glyphicon glyph='import'/>
</Modal.Header>
<Modal.Body>
<form onSubmit={this.handleImportAccount}>
<Input
type='text'
@ -84,9 +76,9 @@ module.exports = ImportAccountModalButton = React.createClass({ @@ -84,9 +76,9 @@ module.exports = ImportAccountModalButton = React.createClass({
/>
<Input type='submit' value='Import Account' data-dismiss="modal" />
</form>
</div>
</Modal.Body>
</Modal>
</Button>
);
}
});

23
jsx/profile/EditAvatarModalButton.js

@ -3,7 +3,6 @@ @@ -3,7 +3,6 @@
var ReactBootstrap = require('react-bootstrap')
, OverlayMixin = ReactBootstrap.OverlayMixin
, Button = ReactBootstrap.Button
, ButtonGroup = ReactBootstrap.ButtonGroup
, Glyphicon = ReactBootstrap.Glyphicon
@ -16,7 +15,6 @@ var SafeStateChangeMixin = require('../common/SafeStateChangeMixin.js'); @@ -16,7 +15,6 @@ var SafeStateChangeMixin = require('../common/SafeStateChangeMixin.js');
var SetIntervalMixin = require("../common/SetIntervalMixin.js");
module.exports = EditAvatarModalButton = React.createClass({
mixins: [OverlayMixin,SafeStateChangeMixin],
getInitialState: function () {
return {
isModalOpen: false,
@ -116,18 +114,11 @@ module.exports = EditAvatarModalButton = React.createClass({ @@ -116,18 +114,11 @@ module.exports = EditAvatarModalButton = React.createClass({
return (
<Button onClick={this.handleToggle} className="link-button-gray pull-right fullytight_all" bsStyle="link">
<Glyphicon glyph='pencil' />
</Button>
);
},
renderOverlay: function() {
if (!this.state.isModalOpen) {
return <span/>;
}
return (
<Modal bsStyle='primary' title={<Glyphicon glyph='pencil'/>} onRequestHide={this.handleToggle}>
<div className='modal-body'>
<Modal bsStyle='primary' show={this.state.isModalOpen} onHide={this.handleToggle}>
<Modal.Header>
<Glyphicon glyph='pencil'/>
</Modal.Header>
<Modal.Body>
<form onSubmit={this.handleAvatarEdit}>
<img src={this.state.avatar}/>
<Input
@ -137,9 +128,9 @@ module.exports = EditAvatarModalButton = React.createClass({ @@ -137,9 +128,9 @@ module.exports = EditAvatarModalButton = React.createClass({
/>
<Input type='submit' value='Update Avatar' data-dismiss="modal" />
</form>
</div>
</Modal.Body>
</Modal>
</Button>
);
}
});

23
jsx/profile/EditProfileModalButton.js

@ -1,6 +1,5 @@ @@ -1,6 +1,5 @@
var ReactBootstrap = require('react-bootstrap')
, OverlayMixin = ReactBootstrap.OverlayMixin
, Button = ReactBootstrap.Button
, ButtonGroup = ReactBootstrap.ButtonGroup
, Glyphicon = ReactBootstrap.Glyphicon
@ -13,7 +12,6 @@ var SafeStateChangeMixin = require('../common/SafeStateChangeMixin.js'); @@ -13,7 +12,6 @@ var SafeStateChangeMixin = require('../common/SafeStateChangeMixin.js');
var SetIntervalMixin = require("../common/SetIntervalMixin.js");
module.exports = EditProfileModalButton = React.createClass({
mixins: [OverlayMixin],
getInitialState: function () {
return {
isModalOpen: false,
@ -77,18 +75,11 @@ module.exports = EditProfileModalButton = React.createClass({ @@ -77,18 +75,11 @@ module.exports = EditProfileModalButton = React.createClass({
return (
<Button onClick={this.handleToggle} className="link-button-gray pull-right fullytight_all" bsStyle="link">
<Glyphicon glyph='pencil' />
</Button>
);
},
renderOverlay: function() {
if (!this.state.isModalOpen) {
return <span/>;
}
return (
<Modal bsStyle='primary' title={<Glyphicon glyph='pencil'/>} onRequestHide={this.handleToggle}>
<div className='modal-body'>
<Modal bsStyle='primary' show={this.state.isModalOpen} onHide={this.handleToggle}>
<Modal.Header>
<Glyphicon glyph='pencil'/>
</Modal.Header>
<Modal.Body>
<form onSubmit={this.handleProfileEdit}>
<Input
type='text'
@ -116,9 +107,9 @@ module.exports = EditProfileModalButton = React.createClass({ @@ -116,9 +107,9 @@ module.exports = EditProfileModalButton = React.createClass({
/>
<Input type='submit' value='Update Profile' data-dismiss="modal" />
</form>
</div>
</Modal.Body>
</Modal>
</Button>
);
}
});
Loading…
Cancel
Save