fix problems with editing cards and columns that

were created in previous change
This commit is contained in:
ali asaria 2014-08-17 20:30:25 -04:00
parent de6a1b22b7
commit 7fdbeec800
4 changed files with 66 additions and 55 deletions

View file

@ -165,14 +165,22 @@ h2 {
.bottom-icon {
padding: 5px;
opacity: .3;
opacity: .4;
}
.bottom-icon:hover {
padding: 5px;
opacity: .6;
}
.faded-icon {
opacity: .4;
}
.faded-icon:hover {
opacity: .6;
}
#add-col {
position: absolute; right: 3px; top: 200px; display: none; opacity: .15;
}
@ -496,11 +504,17 @@ input:hover {
background-color: rgba(128, 128, 256,0.1)
}
.config {
position: fixed;
right: 18px;
top: 4px;
}
.trash {
position: fixed;
right: 18px;
bottom: 4px;
}

View file

@ -272,19 +272,20 @@ function drawNewCard(id, text, x, y, rot, colour, sticker, animationspeed)
sendAction( 'deleteCard' , { 'id': id });
}
);
card.children('.content').editable( "/edit-card/" + id,
{
style : 'inherit',
cssclass : 'card-edit-form',
type : 'textarea',
placeholder : 'Double Click to Edit.',
onblur: 'submit',
xindicator: '<img src="/images/ajax-loader.gif">',
event: 'dblclick', //event: 'mouseover'
callback: onCardChange
}
);
card.children('.content').editable(function(value, settings) {
onCardChange( id, value );
return(value);
}, {
type : 'textarea',
submit : 'OK',
style : 'inherit',
cssclass : 'card-edit-form',
type : 'textarea',
placeholder : 'Double Click to Edit.',
onblur: 'submit',
event: 'dblclick', //event: 'mouseover'
});
//add applicable sticker
if (sticker != null)
@ -292,15 +293,9 @@ function drawNewCard(id, text, x, y, rot, colour, sticker, animationspeed)
}
function onCardChange( text, result )
{
var path = result.target;
//e.g. /edit-card/card46156244
var id = path.slice(11);
function onCardChange( id, text )
{
sendAction('editCard', { id: id, value: text });
}
function moveCard(card, position) {
@ -395,7 +390,6 @@ function initCards( cardArray )
// cols
//----------------------------------
function drawNewColumn (columnName)
{
var cls = "col";
@ -404,42 +398,42 @@ function drawNewColumn (columnName)
cls = "col first";
}
$('#icon-col').before('<td class="' + cls + '" width="10%" style="display:none"><h2 id="col1" class="editable">' + columnName + '</h2></td>');
$('.editable').editable( "/edit-column",
{
style : 'inherit',
cssclass : 'card-edit-form',
type : 'textarea',
placeholder : 'New',
onblur: 'submit',
width: '',
height: '',
xindicator: '<img src="/images/ajax-loader.gif">',
event: 'dblclick', //event: 'mouseover'
callback: onColumnChange
}
);
console.log(totalcolumns);
$('#icon-col').before('<td class="' + cls + '" width="10%" style="display:none"><h2 id="col-' + (totalcolumns+1) + '" class="editable">' + columnName + '</h2></td>');
$('.editable').editable(function(value, settings) {
onColumnChange( this.id, value );
return(value);
}, {
style : 'inherit',
cssclass : 'card-edit-form',
type : 'textarea',
placeholder : 'New',
onblur: 'submit',
width: '',
height: '',
xindicator: '<img src="/images/ajax-loader.gif">',
event: 'dblclick', //event: 'mouseover'
});
$('.col:last').fadeIn(1500);
totalcolumns ++;
}
function onColumnChange( text, settings )
function onColumnChange( id, text )
{
var names = Array();
//Get the names of all the columns
//Get the names of all the columns right from the DOM (ignore what was sent in function)
$('.col').each(function() {
names.push(
$(this).text()
);
);
});
updateColumns(names);
}
function displayRemoveColumn()
@ -515,13 +509,9 @@ function initColumns( columnArray )
column
);
}
}
function changeThemeTo( theme )
{
currentTheme = theme;