(tooltip) footer being dropped if content template is turned on? #part2
@mgcrea I'm revisiting this question, I just pulled the latest version rc4. And I do see now where you are coming from. I believe the logic is wrong. I just realized this because of the comment you added recently.
// Drop the default footer as you probably don't want it if you use a custom contentTemplate if (!config.template) first, we are talking about content template not template. So the condition should be if (!config.contentTemplate). Because right now it doesn't matter if you configure content template or not because its looking for the template config variable.
Now moving forward, content template is customization of the content block, which is both outside the header and footer block. If I wanted to have a different footer, then I would have change the default template would I?
So dropping the footer doesn't make sense here if you only want to customize the content block (because the user only concerned about customizing the content and not the other elements) and footer is outside of its scope as you have previously mentioned.
If this is acceptable I can prep a pull request.
@stylenclass I guess it makes sense, but you would often want to change the footer as well. That's how AngularJS v0.x worked. It's breaking but I think I'll make the change.
+1 to that.
The reason I saw this issue is that I was looking for a feature that might be missing...
I like to use contentTemplate property. This way I do not have to have a template of the whole modal. However, I need a way to customize footer so that the buttons that I put in it do appropriate actions. It appears currently there is no way to achieve this.
I really like this implementation by bootboxjs of this feature. Basically, you can write something like this and you buttons will be displayed bound to the actions you want:
bootbox.dialog({
message: "I am a custom dialog",
title: "Custom title",
buttons: {
success: {
label: "Success!",
className: "btn-success",
callback: function() {
Example.show("great success");
}
},
danger: {
label: "Danger!",
className: "btn-danger",
callback: function() {
Example.show("uh oh, look out!");
}
},
main: {
label: "Click ME!",
className: "btn-primary",
callback: function() {
Example.show("Primary button");
}
}
}
});
It would be nice if this library could do something similar.
Actually, this line https://github.com/mgcrea/angular-strap/blob/master/src/modal/modal.js#L80 is a dirty hack and should be removed.
I faced this issue trying to use my own dialog template, setting it using
angular.extend($modalProvider.defaults, {
template: 'js/partials/modal-dialog.phtml',
});
If I want to change a footer, I will do that explicitly changing main template.
Old discussion, but I see this code still in the source, so I think it's still a relevant conversation.
It seems like dropping the footer should just be a boolean config option, not a hardcoded part of the contentTemplate code.
Additionally, a footerTemplate would be useful. Sometimes you just want simple text in your modal, but customized buttons that lead to specialized actions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.