Merge remote-tracking branch 'origin/master'

This commit is contained in:
Pootle server 2011-06-19 14:40:08 +02:00
commit a353da9219
2 changed files with 23 additions and 17 deletions

View File

@ -50,7 +50,7 @@ function setFieldValue(field, field_type, value) {
field.attr('checked', (value != undefined ? value : field.attr('defaultChecked')));
break;
case 'select':
var options = field.attr('options');
var options = field.prop('options');
var i, imax = options.length;
if (value == undefined) {
for (i = 0; i < imax; i++) {

View File

@ -347,14 +347,16 @@
showHint: function(e) {
if (!this.colRsz && !this.colMov) { // if not resizing or dragging
var text = '';
if (this.showReorderHint) {
if (this.showReorderHint && this.reorderHint) {
text += this.reorderHint;
}
if (this.showSortHint) {
if (this.showSortHint && this.sortHint) {
text += text.length > 0 ? '<br />' : '';
text += this.sortHint;
}
if (this.showMarkHint) {
if (this.showMarkHint && this.markHint &&
!this.showSortHint // we do not show mark hint, when sort hint is shown
) {
text += text.length > 0 ? '<br />' : '';
text += this.markHint;
}
@ -456,9 +458,6 @@
g.sortHint = $('#sort_hint').val();
g.markHint = $('#col_mark_hint').val();
// determine whether to show the column reordering hint or not
g.showReorderHint = $firstRowCols.length > 1;
// initialize column order
$col_order = $('#col_order');
if ($col_order.length > 0) {
@ -491,32 +490,39 @@
.wrapInner('<span />');
// register events
if ($firstRowCols.length > 1) {
if ($firstRowCols.length > 1 && g.reorderHint) { // make sure columns is reorderable
$(t).find('th.draggable')
.css('cursor', 'move')
.mousedown(function(e) {
g.dragStartMove(e, this);
})
.mouseenter(function(e) {
g.showReorderHint = true;
g.showHint(e);
})
.mouseleave(function(e) {
g.showReorderHint = false;
g.showHint(e);
});
}
$(t).find('th.draggable')
.mouseenter(function(e) {
g.showMarkHint = !g.showSortHint;
g.showHint(e);
})
.mouseleave(function(e) {
g.hideHint();
});
$(t).find('th.draggable a')
.attr('title', '') // hide default tooltip for sorting
.mouseenter(function(e) {
g.showSortHint = true;
g.showMarkHint = false;
g.showHint(e);
})
.mouseleave(function(e) {
g.showSortHint = false;
g.showHint(e);
});
$(t).find('th.marker')
.mouseenter(function(e) {
g.showMarkHint = true;
g.showHint(e);
})
.mouseleave(function(e) {
g.showMarkHint = false;
g.showHint(e);
});
$(document).mousemove(function(e) {
g.dragMove(e);