[IMP] website: media editor: change button on keyup
bzr revid: chm@openerp.com-20140408094703-7qayghtm88qku3jz
This commit is contained in:
@@ -1454,13 +1454,8 @@
|
||||
},
|
||||
'change input[type=file]': 'file_selection',
|
||||
'submit form': 'form_submit',
|
||||
'change input.url': function (e) {
|
||||
if ($(e.target).val() === "") {
|
||||
this.$("button").addClass("btn-default").removeClass("btn-primary");
|
||||
} else {
|
||||
this.$("button").removeClass("btn-default").addClass("btn-primary");
|
||||
}
|
||||
},
|
||||
'change input.url': "change_input",
|
||||
'keyup input.url': "change_input",
|
||||
//'change select.image-style': 'preview_image',
|
||||
'click .existing-attachments img': 'select_existing',
|
||||
'click .existing-attachment-remove': 'try_remove',
|
||||
@@ -1511,6 +1506,16 @@
|
||||
this.trigger('cancel');
|
||||
},
|
||||
|
||||
change_input: function (e) {
|
||||
var $input = $(e.target);
|
||||
var $button = $input.parent().find("button");
|
||||
if ($input.val() === "") {
|
||||
$button.addClass("btn-default").removeClass("btn-primary");
|
||||
} else {
|
||||
$button.removeClass("btn-default").addClass("btn-primary");
|
||||
}
|
||||
},
|
||||
|
||||
search: function (needle) {
|
||||
var self = this;
|
||||
this.fetch_existing(needle).then(function () {
|
||||
@@ -1861,7 +1866,9 @@
|
||||
'click input#urlvideo ~ button': 'get_video',
|
||||
'click input#embedvideo ~ button': 'get_embed_video',
|
||||
'change input#urlvideo': 'change_input',
|
||||
'change input#embedvideo': 'change_input'
|
||||
'keyup input#urlvideo': 'change_input',
|
||||
'change input#embedvideo': 'change_input',
|
||||
'keyup input#embedvideo': 'change_input'
|
||||
}),
|
||||
start: function () {
|
||||
this.$iframe = this.$("iframe");
|
||||
|
||||
@@ -147,18 +147,19 @@
|
||||
target="fileframe"
|
||||
class="form-inline">
|
||||
<div class="well">
|
||||
<div class="pull-right">
|
||||
<label for="iamgeurl">Image URL</label>
|
||||
<div class="form-group pull-left">
|
||||
<input type="file" name="upload" accept="image/*" style="position: absolute; opacity: 0; width: 1px; height: 1px;"/>
|
||||
<button type="button" class="btn btn-primary filepicker">Upload an image from your computer</button>
|
||||
<button type="button" class="btn hidden wait" disabled="disabled">Uploading...</button>
|
||||
</div>
|
||||
<div>
|
||||
<span class="text-muted"> — or — </span>
|
||||
<label for="iamgeurl">Add an image URL</label>
|
||||
<div class="form-group btn-group">
|
||||
<input type="text" name="url" class="form-control url pull-left" style="width: 320px;" id="iamgeurl" placeholder="http://openerp.com/logo.png"/>
|
||||
<button class="btn btn-default" type="submit">Add</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="file" name="upload" accept="image/*" style="position: absolute; opacity: 0; width: 1px; height: 1px;"/>
|
||||
<button type="button" class="btn btn-primary filepicker">Upload an image from your computer</button>
|
||||
<button type="button" class="btn hidden wait" disabled="disabled">Uploading...</button>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="func"/>
|
||||
<div class="help-block"/>
|
||||
|
||||
Reference in New Issue
Block a user