Skip to content
Snippets Groups Projects
Commit e7a7138f authored by Allen Gilliland's avatar Allen Gilliland
Browse files

cloning functionality (sort of).

parent eba07d0c
No related branches found
No related tags found
No related merge requests found
......@@ -148,7 +148,11 @@ CardControllers.controller('CardDetail', [
}
},
notifyCardDeletedFn: function () {
$location.path('/')
$location.path('/');
},
cloneCardFn: function(cardId) {
console.log('path=', '/card/create?clone='+cardId);
$location.path('/card/create/?clone='+cardId);
}
};
......
......@@ -71,6 +71,10 @@ export default React.createClass({
return this.saveCard(this.props.card);
},
cloneCard: function() {
this.props.cloneCardFn(this.props.card.id);
},
saveCard: function(card) {
var component = this,
apiCall;
......@@ -125,6 +129,7 @@ export default React.createClass({
component.props.setQueryModeFn(mode);
});
},
permissions: function() {
var permission;
if(this.props.card.public_perms) {
......@@ -196,11 +201,14 @@ export default React.createClass({
);
}
var cloneButton = (
<span className="mx1 text-grey-4 text-brand-hover">
<Icon name='clone' width="18px" height="18px"></Icon>
</span>
);
var cloneButton;
if (this.props.card.id) {
cloneButton = (
<span className="mx1 text-grey-4 text-brand-hover">
<Icon name='clone' width="18px" height="18px" onClick={this.cloneCard}></Icon>
</span>
);
}
var queryModeToggle;
if (this.cardIsNew() && !this.cardIsDirty()) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment