json_ = json.dumps(data)
- default_attrs = {'class': 'embedding', 'data-content-types': json_ }
+ default_attrs = {'class': 'embedding vLargeTextField', 'data-content-types': json_ }
if attrs:
default_attrs.update(attrs)
.embed-widget{
- background:#DDD;
- padding:2px;
- border:1px solid #CCC;
- border-radius:5px;
- -webkit-border-radius:5px;
- -moz-border-radius:5px;
- display:inline-block;
- margin:0 -3px;
+ float:left;
}
.embed-toolbar{
- padding-bottom:3px;
+ border:1px solid #CCC;
+ border-bottom:0;
+ padding:3px 5px;
+ background:#EEE -webkit-linear-gradient(#F5F5F5, #DDD);
+ background:#EEE -moz-linear-gradient(#F5F5F5, #DDD);
+ background-color:#EEE;
+}
+.embed-widget textarea{
+ margin-top:0;
+}
+.embed-widget button, .embed-widget select{
+ vertical-align:middle;
+ margin-right:3px;
}
.embed-toolbar button{
background:#FFF;
-moz-border-radius:3px;
color:#666;
}
-.embed-toolbar select, .embed-toolbar button{
- margin-right:3px;
-}
.embed-toolbar button:hover{
color:#444;
}
color:#FFF;
background:#666;
border-color:#666;
+}
+
+.grappelli .embed-widget{
+ background:#DDD;
+ padding:2px;
+ border:1px solid #CCC;
+ border-radius:5px;
+ -webkit-border-radius:5px;
+ -moz-border-radius:5px;
+ display:inline-block;
+ margin:0 -3px;
+}
+.grappelli .embed-toolbar{
+ padding-bottom:3px;
}
\ No newline at end of file
// otherwise, do what you usually do
oldDismissRelatedLookupPopup.apply(this, arguments);
}
+
+ // overload the dismissAddAnotherPopup function
+ oldDismissAddAnotherPopup = window.dismissAddAnotherPopup;
+ window.dismissAddAnotherPopup = function (win, newId, newRepr) {
+ var name = windowname_to_id(win.name),
+ elem = $('#'+win.name), val;
+ if (elem.parent().hasClass('embed-widget')) {
+ dismissRelatedLookupPopup(win, newId);
+ }
+ // otherwise, do what you usually do
+ oldDismissAddAnotherPopup.apply(this, arguments);
+ }
+
+ // Add grappelli to the body class if the admin is grappelli. This will allow us to customize styles accordingly.
+ if (window.grappelli) {
+ $(document.body).addClass('grappelli');
+ }
},
parseContentTypes: function () {
var string = widget.EmbedFields.eq(0).attr('data-content-types'),