MCPcopy Create free account
hub / github.com/baumgarr/nixnote2 / backtabPressed

Method backtabPressed

gui/nbrowserwindow.cpp:2004–2036  ·  view source on GitHub ↗

Backtab pressed.

Source from the content-addressed store, hash-verified

2002
2003 // Backtab pressed.
2004 void NBrowserWindow::backtabPressed() {
2005 if (insideEncryption)
2006 return;
2007 if (insideList)
2008 shiftLeftButtonPressed();
2009 if (insideTable) {
2010 QString js = "function getCursorPosition() { "
2011 " var selObj = window.getSelection();"
2012 " var selRange = selObj.getRangeAt(0);"
2013 " var workingNode = window.getSelection().anchorNode;"
2014 " var rowCount = 0;"
2015 " var colCount = 0;"
2016 " while(workingNode != null && workingNode.nodeName.toLowerCase() != 'table') { "
2017 " if (workingNode.nodeName.toLowerCase()=='tr') {"
2018 " rowCount = rowCount+1;"
2019 " }"
2020 " if (workingNode.nodeName.toLowerCase() == 'td') {"
2021 " colCount = colCount+1;"
2022 " }"
2023 " if (workingNode.previousSibling != null)"
2024 " workingNode = workingNode.previousSibling;"
2025 " else "
2026 " workingNode = workingNode.parentNode;"
2027 " }"
2028 " var nodes = workingNode.getElementsByTagName('tr');"
2029 " var tableRows = nodes.length;"
2030 " nodes = nodes[0].getElementsByTagName('td');"
2031 " var tableColumns = nodes.length;"
2032 " window.browserWindow.setTableCursorPositionBackTab(rowCount, colCount, tableRows, tableColumns);"
2033 "} getCursorPosition();";
2034 editor->page()->mainFrame()->evaluateJavaScript(js);
2035 }
2036 }
2037
2038
2039

Callers 1

eventMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected