How to change this block's position? - drupal-7

Before this block was up there in position 1.
Once I shifted the position of some blocks, not replaced it with her on top again.
What is the name of this block and how can I reposition it to position 1?

Check if you have any problem with your CSS styling on that block, position: absolute or something similar
Try clearing the cache (/admin/config/performance/clear-cache or drush cc all )
Revert back the changes to debug the issue:
May be you introduced something new , you are not aware of , or you can't think of .

Related

How to click element with zero height with Capybara?

The error I'm getting is: element not interactable: element has zero size
I have an element with a button tag with text. However, the element.style has two attributes of 0px height (and 0px padding, if that matters).
The only workaround I've found is to interact with some other element that I can find (higher up in the hierarchy of the markup), and then use x and y offsets to click this button. However that ends up flaky because the size of the element can change, and the button is off to the lower right corner.
I'm willing to go the extra mile and calculate the proper coordinates, but I'm not able to figure out how to get the width of the element either. I'm also willing to just use some javascript to click as a last resort. Ideally I'd love to know if there is something more clean and elegant for this problem.
Thank you!
I think you can enable js for this test and use a trick for it.
Smth like that:
page.execute_script("$('#container img').css('height', '10px;')")
find('#container img').click
page.execute_script("$('#container img').css('height', '0')")
I ended up using actionbuilder to work around this problem, like this:
el = find('button', :text => '+ 1').native
actionbuilder = page.driver.browser.action # Use actionbuilder to workaround zero height button
actionbuilder.click(el).perform
I'm not sure if this is the way to go but that seems to have helped and maybe might help someone else out there.

SVG unit system is different than expected

In the screenshot of the DOM you can see that the text ending in the numbers 623 is given a x value of 160. However, when I inspect the text, something something which is rendered before the numbers it has a length of 126.08px (see the second screenshot). This means that my text, which I translated 160px to the right, is not actually 160px to the right. From this article, I understand that unless a viewport is provided one user unit should equal one screen unit, but this is obviously not the case here. Why is this? Thanks! I'm using React if that is necessary.
You're setting "text-anchor' to "end' which will end up shifting the text to the left. Set it to 'start' (or possibly skip it altogether) and you should see the behavior you expect.

set selection range after set innerText (angular js)

I have two directives. The first one called restricted-text watch for ngModel changes and replace current value with old one if new one doesn't respect given regexp. It works very well when placed on input.
The second one is a directive called input-editable. It's a span[contendeditable]. It works very well too.
Then, we plug the first one on the second :
<input-editable ng-model="lol" restricted-text="^[a-z]+$"></input-editable>
and it fails…
When I type a not allowed character, then, the content of the spec is well changed. But ! The crret go back to the start of the span. I would like the caret stays at the same place, or at worst, go the the end like an input. I've tried lot of things with getSelection and createRange, all that I get is the caret position. The cursor don't move when I call setStart.
Have a look here

reorder array-table row and update database

I've been looking for a way to do something and I'm convinced I've been using the wrong search criteria to finding a solution...so, here I am.
I have a dropdown menu in a content management system that when a new page is created or position is edited, the database is updated with the new or edited value...this is all working great.
However, what I'd like to do is...when a number for the page position is changed from let's say, position 5 to position 1...the former position number 1 is changed to position number 2...and every position number for any pages remaining are renumbered accordingly.
So, my question is, how do I UPDATE my database so, whenever I change the position of the page in the dropdown menu, ALL position values get, I don't know, a +1...or something...and additionally, NOT allowing two position values to be the same...you know, there can be only one...
Thanks in advance...hope I didn't do too bad in explaining what I'd like to do :-)
Have you tried something like:
UPDATE my_table SET position=position+1 WHERE position>2 AND position<5
The where statement should be the new position & old position of the one you've just updated

How to make a scroller on a micro-processor/-controller?

I would like to write a text scroller on a micro-processor with 4 5x7 displays in ANSI-C.
Does anyone know of example source code or anything that can help me get started?
Update
This is the user manual for the micro-processor board I have. On PDF page 17 is a picture of the board with the displays.
The code is written in an IDE called "zds2_Z8Encore493.exe" and then flashed to the micro-controller over serial port.
I would like the text to cascade from one to the next to the next column-by-column, so it is smooth.
There may be a better way, but I would store the text in a block of RAM, and in the routines that update the displays I would include a value to offset the starting point, possibly with a wrap-around to the start. The you store a counter which increments the "global" offset (scrolling).
You can then use string[offset + display-width + scroll_position] as the start pointer, but you need to detect the end and wrap round or just stop.

Resources